cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member561174
Participant
0 Kudos

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.

'<soapenv:Header>'

'<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'

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

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

            '<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">paswd</wsse:Password>'

            '<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">MT0B9XFzsZJXXKmVKOsj/Q==</wsse:Nonce>'

            '<wsu:Created>2015-03-30T06:29:17.407Z</wsu:Created>'

'</wsse:UsernameToken>'

'</wsse:Security>'

'</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?

BR,

Nisha Verma

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member561174
Participant
0 Kudos

Hello Harald,

We could not solve the issue, ultimately involved PI to get it working.

Please do share if you manage to get any solution.

BR,

Nisha

former_member561174
Participant
0 Kudos

Hello Experts,

I have not found the solution yet.

Can anyone provide some insight??

BR,

Nisha Verma

Former Member
0 Kudos

Hi Nisha,

I'm facing the same problem. Have you already found a solution for this?

regards,

Harald