Skip to Content
Apr 02, 2015 at 06:23 AM

Unable to add custom SOAP header to consumer webservice in CRM( without using PI)


Hello Experts,

We have a requirement to consume webservice proxy in CRM without involving PI. We have WSDL file which has many services as depicted in the first screenshot.After checking old posts, I could add custom SOAP header by using if_wsprotocol_ws_header and there is no xml parsing error for ws_header.Have used if_ixml_stream_factory to check xml parsing error for header.


'<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="" xmlns:wsu="">'

'<wsse:UsernameToken wsu:Id="UsernameToken-2">'

'<wsse:Username>user id</wsse:Username>'

'<wsse:Password Type="">paswd</wsse:Password>'

'<wsse:Nonce EncodingType="">MT0B9XFzsZJXXKmVKOsj/Q==</wsse:Nonce>'




'</soapenv:Header>' INTO l_string.

But when my ABAP program as a whole gets executed where consumer proxy is called, then it still throws XML parsing error - undeclared namespace prefix. As mentioned, there is no parsing error for header and WSDL file as a whole in SOAP UI tool works fine,by manually adding SOAP header.

Have configured SOAMANAGER with logical port.Or any wrong setting in SOAMANAGER can cause this issue? When I tested webservice ping, it gave me attached error but I read in a SAP note that such error can be ignored.

I want to know if some more setting/coding is required if we manually add custom header to a payload? Is PI really required to implement this requirement? Payload mapping has to be done to add custom header and if that can be taken care by ABAP coding and how?

Can you please help?


Nisha Verma