Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SOAP MANAGEMENT HEADER

Former Member
0 Likes
954

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.
1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
0 Likes
679

Do a SOAP trace (SOAMANAGER) to make sure the content of the message built/sent. It will be easier to analyze the issue.