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

SOAP Request for calling a non SAP Proxy Consumer including Authentication

Former Member
0 Kudos

Hello everyone,

I am trying to consume a Web Service from BMC Remedy (non-SAP System) in SAP Solution Manager. I have generated the required ABAP Proxy Class from the WSDL file, created a logical port along with the authentification details using SOAMANAGER and instantiated the proxy class in an ABAP Program along with the request parameters to call the service. I keep getting the error message:- SoapFaultCode: 1.

Hence; I tried calling the service using the external open Source Program: SOAPUI 3.0.1. Here I saw that the SOAP Request includes a SOAP Header, whether the authentification details are embedded. After I added these details in the Request in SOAPUI, I could test the service successfully.

Now, I went back to the SAP system and saw that the Proxy Runtime generated only the ABAP types for the SOAP Body but no parameters were created for the SOAP Header. I found in SDN that the interface for adding SOAP Header is 'if_wsprotocol_ws_header'. Unfortunately, I did not find any documentation for it. So I just tried similar to the coding example of Thomas Jung but now I get XML parsing errors.

Can someone give me a working coding example or tutorial to solve this SOAP Header Problem? I am not sure if I am calling the following method correctly?

    • CALL METHOD lo_ws_header->if_wsprotocol_ws_header~set_request_header( name = name namespace =

    • namespace dom = xml_element ).

I would be really thankful if someone out there can help me to solve this problem.

PS: Following is the SOAP Request from SOAP UI that I need to build in the SAP System:-

<soapenv:Envelope xmlns:soapenv="" xmlns:urn="urn:THD_Global_Interface_Ticket_V3">






















Edited by: Manisha Rostewitz on Nov 18, 2009 10:48 PM

Problem solved with the correct implementation of CALL METHOD lo_ws_header->if_wsprotocol_ws_header~set_request_header( name = name namespace =

    • namespace dom = xml_element ).


Former Member
0 Kudos

Problem is solved!

0 Kudos

Hi, Manisha,

Im aslo getting the same error "soapfaultcode:1".Can you please explain in detail how did resolve the issue.



0 Kudos


in my case the Authentication was embedded in the SOAP Header. Following code was supplied by SAP support, which helped to solve the problem.

Although the SOAPFaultCode = 1, can be any other problem with the soap communication. I will recommend to use the open source tool 'SOAPUI', which gives clearer error messages!

  lr_header_protocol TYPE REF TO if_wsprotocol_ws_header,
  lr_xml_document    TYPE REF TO if_ixml_document,
  lr_xml_element     TYPE REF TO if_ixml_element,
  lv_xstring         TYPE xstring.

CONCATENATE '<soapenv:Header xmlns:urn="urn:THD_Global_Interface_Ticket_V3">'
'<urn:userName>' username '</urn:userName>'
'<urn:password>' password '</urn:password>'
INTO iv_xml.

lr_header_protocol ?= ir_header_protocol.
" CONVERT to iv_xml to xstring
cl_abap_conv_out_ce=>create( )->convert( EXPORTING data = iv_xml IMPORTING buffer = lv_xstring ).
" CREATE ixml dom document from XML xstring
    xml           = lv_xstring
    document      = lr_xml_document
    invalid_input = 1
    OTHERS        = 2.

IF sy-subrc = 0 AND lr_xml_document IS NOT INITIAL.
  lr_xml_element ?= lr_xml_document->get_root_element( )->get_first_child( ).
  " ADD header element by element to soap header
  WHILE NOT lr_xml_element IS INITIAL.
    name = lr_xml_element->get_name( )
     namespace = lr_xml_element->get_namespace_uri( )
    dom = lr_xml_element ).
    lr_xml_element ?= lr_xml_element->get_next( ).

Former Member
0 Kudos

Hi Manisha,

I am just wondering where you stored the user ID and password and how you read it to pass it when you called the non SAP webservice.