04-07-2010 2:05 PM
HI
I having a method that call to Web service and i need to add additional info
like key and value ,
there is API (method or FM )which i can use for the purpose ?
Regards
James
Edited by: James Herb on Apr 7, 2010 3:37 PM
04-08-2010 3:32 PM
I don't think these guys recommending CL_HTTP_CLIENT understand the web service protocols. Since you are using a consumer proxy to call a web service method, then to add a message header field (SOAP envelope header), you need to use the web service runtime protocol WS_HEADER provided for that. You would access this through method IF_PROXY_BASIS~GET_PROTOCOL which is attached to your proxy object. See the documentation in the help files or for interface IF_WSPROTOCOL for an example.
04-07-2010 4:16 PM
Hi James,
There are plenty of classes starting with CL_HTTP_*. We were used cl_http_client and http_client classes for webservices purpose. Please try with this classes. Below are might be useful.
cl_http_client=>create_by_url
http_client->send
http_client->receive
http_client->close
Saravanan V
04-07-2010 5:17 PM
HI SARAVANAN ,
Thanks ,
i call to a client WS maybe do you know how can i do that ,any example ?
Regards
James
Edited by: James Herb on Apr 7, 2010 10:50 PM
04-07-2010 10:14 PM
To call a web service, you have to create a proxy in SAP (SE80, other object, enterprise services). See sap library http://help.sap.com/saphelp_nw70/helpdata/EN/02/265c3cf311070ae10000000a114084/frameset.htm.
What kind of header do you want to add??
04-08-2010 8:22 AM
HI Sandra ,
I create Client proxy from WSDL (.Net service) that my colleague
send to me and I call to it as follows
DATA: lo_client_proxy TYPE REF TO co_task_web_service.
CALL METHOD lo_client_proxy->crt_task
EXPORTING
input = ls_input
IMPORTING
output = ls_output.
but he told me that he want that I add additional data to the HTTP header as follows
Request.Headers.Add("X-FORS_BASED_A_APTED", "t");
How I can do that ?
if it not possible please let me know
Thanks and Regards
James
Edited by: James Herb on Apr 8, 2010 2:00 PM
Edited by: James Herb on Apr 8, 2010 2:20 PM
04-08-2010 1:47 PM
Hi James,
I would recommend to use the class CL_HTTP_CLIENT.
Here we have been provided with the method SET_HEADER_FIELD.
We can add extra information through this method.
Please revert if something is unclear.
Thanks,
Daya.
04-08-2010 2:09 PM
HI daya mishra
Thanks ,
How i can use it in my case before or after the call to the WS can you give me some example ?
Regards
James
Edited by: James Herb on Apr 8, 2010 4:22 PM
04-08-2010 3:32 PM
I don't think these guys recommending CL_HTTP_CLIENT understand the web service protocols. Since you are using a consumer proxy to call a web service method, then to add a message header field (SOAP envelope header), you need to use the web service runtime protocol WS_HEADER provided for that. You would access this through method IF_PROXY_BASIS~GET_PROTOCOL which is attached to your proxy object. See the documentation in the help files or for interface IF_WSPROTOCOL for an example.
04-08-2010 9:17 PM
04-13-2010 8:17 AM
HI ,
Thanks but this is for soap envelope and not for the HTTP header .
Regards
James
04-13-2010 8:30 AM
HI James ,
Unfortunately you cannot set any attributes on the HTTP header when you using Web service .
Regards
Shimon Tal