on ‎2018 Dec 05 11:51 AM
Hi all,
I have trouble consuming an external webservice.
I have created the service consumer and the proxy with a wsdl file from the provider of the web service.
Since there is no header specified in the xml structure by the provider, I have to create it.
The provider told me to set this as the header for authentification:
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>Webservice-User</wsse:Username>
<wsse:Password >Passwort</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
I set the header with method set_request_header of interface if_wsprotocol_ws_header which works fine.
Now when I call the webservice in my report, I get the following Exception:
CX_SXML_PARSE_ERROR - Error while parsing xml-stream: 'undeclared namespace prefix'.
There has to be something wrong with the xml but I have no idea if its the header or the body, since the error does not provide any other information.
Since the body of the xml was set automatically by the use of a wsdl file, I dont think that the error is in the body.
Do you guys have a clue what I could do to find the solution?
I can provided the code of my web service call and the xml body, if needed.
Thank you very much!
Best regards
Chris
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
I solved it myself.
The header has to look like this:
'<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:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
'<wsse:UsernameToken>'
'<wsse:Username>XXX</wsse:Username>'
'<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXX</wsse:Password>'
'</wsse:UsernameToken>'
'</wsse:Security>'
'</soapenv:Header>'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.