cancel
Showing results for 
Search instead for 
Did you mean: 

How does Web Dynpro ABAP deal with duplicate HTTP request query parameters?

Former Member
0 Kudos

Hi,

I have recently been debugging a WDA application being called from the SAP Portal. I came across the following scenario and am wondering if anyone knows how the WDA framework deals with duplicate HTTP request query parameters.

I can see by running the Network trace in the Chrome developer tools that the query parameter sap-wd-configId is being sent to the WDA app twice in the same HTTP request. The first instance of the parameter is empty/blank the 2nd is populated with a value, e.g.

sap-wd-configId=

sap-wd-configId=XYZ

The result is that the WDA seems to only pick up the first parameter which is empty and responds with the error "Application started with no configuration". When I debug I can get to a point in class CL_WDR_CLIENT_ABSTRACT_HTTP method GET_FORM_FIELDS_EXTENDED where I can see it making a call to some system code that overwrites the 2nd query value with the empty value from the first.

Anyway my question is more general in nature, I am just wondering how the WDA framework is expected to handle duplicate query requests? There appears to be a number of different ways in general http://stackoverflow.com/questions/1746507/authoritative-position-of-duplicate-http-get-query-keys

Thanks,
Simon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Simon

I know you're asking a generic question about how Web Dynpro *should* handle duplicate parameters... unfortunately, I'm not clever enough to answer that one.

But I think can answer the specific question about how Web Dynpro *does* handle duplicate 'sap-wd-configId' parameters.

The 'sap-wd-configId' parameter is actually read in method CL_WDR_CLIENT_ABSTRACT_HTTP=>CREATE_APPLICATION:

  l_config_id = request->get_form_field( cl_wdr_client_constants=>config_id ).

The GET_FORM_FIELD method uses:

  system-call ict did ihttp_scid_get_form_field

to read the specific config parameter and this system-call seems to return only the first parameter value if there is more than one parameter with the same id. This is why your Web Dynpro app would not be receiving the second config id.

Just for clarification, the bit of code you found in CL_WDR_CLIENT_ABSTRACT_HTTP=>GET_FORM_FIELDS_EXTENDED retrieves all of the query parameters at once using:

  system-call ict did ihttp_scid_get_form_fields

but it does this for a different purpose (I think it stores it in the WD window object for later use, or something...)

This system-call will return all parameters, even the duplicates, but this is not how Web Dynpro is specifically handling the WD config id parameter.

I hope this helps a bit.

Regards

Glen

Former Member
0 Kudos

Thanks Glen, esp. for pointing me to the right location in the code! I tried this on another system too and for some reason it works fine if you send sap-wd-confiId twice... hummm... will need to look a bit deeper I think.

Cheers,

Simon

Former Member
0 Kudos

Hi Simon

In your other system, is the WDCONFIGURATIONID parameter being set in addition to the sap-wd-configId parameter?

The sap-wd-configId parameter takes priority over the WDCONFIGURATIONID parameter but if sap-wd-configID is blank (which it will be if the system reads the first of the sap-wd-configID values) then the WD framework will use the WDCONFIGURATIONID value.

Maybe you can use WDCONFIGURATIONID to get around your problem? Might not be ideal but it could work...

Regards

Glen

Former Member
0 Kudos

Thanks Glen,

Is WDCONFIGURATIONID also sent as a HTTP parameter or is it set in the WDA parameters?

Thanks,

Simon

Former Member
0 Kudos

When looking at this, I was just playing around in the browser and sent all of the parameters as URL parameters. I don't know if that makes a difference...

http://host:port/sap/bc/webdynpro/sap/zapp?sap-wd-configId=&sap-wd-configId=XYZ&WDCONFIGURATIONID=AB...

Regards

Glen

Answers (0)