2017 Mar 14 6:31 PM
Hello everyone,
I have added a Header in my request like I saw in many blogs but each times I call the webservice, it asks me my user and password with a popup.
Do you have any idea of what I'm doing wrong?
Thx a lot in advance
Kr,
Marc
IF go_obj IS INITIAL.
CREATE OBJECT go_obj
EXPORTING
logical_port_name = 'YSDWCO_IINDIVIDU_SERVICE'.
ws_header ?= go_obj->get_protocol('IF_WSPROTOCOL_WS_HEADER').
DATA(lv_header) = ysdw_cl_mwam=>get_header_requests_mijnloon( ).
l_xstring = cl_proxy_service=>cstring2xstring( lv_header ).
IF NOT lv_header IS INITIAL.
* create ixml dom document from xml xstring
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = l_xstring
IMPORTING
document = xml_document
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
IF sy-subrc = 0 AND NOT xml_document IS INITIAL.
xml_root = xml_document->get_root_element( ).
xml_element ?= xml_root->get_first_child( ).
* add header element by element to soap header
WHILE NOT xml_element IS INITIAL.
name = xml_element->get_name( ).
namespace = xml_element->get_namespace_uri( ).
ws_header->set_request_header( name = name namespace = namespace dom = xml_element ).
xml_element ?= xml_element->get_next( ).
ENDWHILE.
ENDIF.
ENDIF.
ENDIF.
CALL METHOD go_obj->upload_individus
EXPORTING
input = lv_input
IMPORTING
output = lv_output.
Hello everyone,
I have added a Header in my request like I saw in many blogs but each times I call the webservice, it asks me my user and password with a popup.
Do you have any idea of what I'm doing wrong?
Thx a lot in advance
Kr,
Marc
IF go_obj IS INITIAL.
CREATE OBJECT go_obj
EXPORTING
logical_port_name = 'YSDWCO_IINDIVIDU_SERVICE'.
ws_header ?= go_obj->get_protocol('IF_WSPROTOCOL_WS_HEADER').
DATA(lv_header) = ysdw_cl_mwam=>get_header_requests_mijnloon( ).
l_xstring = cl_proxy_service=>cstring2xstring( lv_header ).
IF NOT lv_header IS INITIAL.
* create ixml dom document from xml xstring
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = l_xstring
IMPORTING
document = xml_document
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
IF sy-subrc = 0 AND NOT xml_document IS INITIAL.
xml_root = xml_document->get_root_element( ).
xml_element ?= xml_root->get_first_child( ).
* add header element by element to soap header
WHILE NOT xml_element IS INITIAL.
name = xml_element->get_name( ).
namespace = xml_element->get_namespace_uri( ).
ws_header->set_request_header( name = name namespace = namespace dom = xml_element ).
xml_element ?= xml_element->get_next( ).
ENDWHILE.
ENDIF.
ENDIF.
ENDIF.
CALL METHOD go_obj->upload_individus
EXPORTING
input = lv_input
IMPORTING
output = lv_output.
2017 Mar 14 7:47 PM
Do a SOAP trace (SOAMANAGER) to make sure the content of the message built/sent. It will be easier to analyze the issue.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |