on 2022 Sep 21 2:07 PM
Hi all !
We're having some troubles creating the correct payload for a soap api call.
Whilst creating an SOAP Envelope, it needs a message ID to be added to the soap envelope header.
We tried several things to add a message ID, even hardcoded.. But whatever we try, we always get this result.
Does someone has the solution to send a SOAP call in the iRPA Cloud Factory with a MessageID?
This is our payload, one of many that did not work 😉
var XMLBody= "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:edi='http://sap.com/xi/EDI'>"+
"<soapenv:Header/>" +
"<soapenv:Body>" +
"<edi:OrderConfRequest>" +
"<MessageHeader>" +
"<CreationDateTime>2022-09-21T18:40:00.001Z</CreationDateTime>" +
"</MessageHeader>" +
"<OrderConfirmation>" +
.............
"</OrderConfirmation>" +
"</edi:OrderConfRequest>" +
"</soapenv:Body>" +
"</soapenv:Envelope>";
var payload = {
'resolveBodyOnly' : true,
'method': 'POST',
'contentType': "text/xml",
'responseType':'json', // parse the response to get a JSON object
'url': URL,
headers: {
'Content-Type': "text/xml",
'Accept': '*/*'
},
'body': XMLBody
};
return payload;
KR,
Jana
Hello Jana,
From the Web Services Best Practices sample, you can see that the Content-Type of the header should be set to irpa_core.enums.request.content.xmlText. Then I would try the following code:
var payload = {
'resolveBodyOnly' : true,
'method': 'POST',
'contentType': "text/xml",
'responseType':'json', // parse the response to get a JSON object
'url': URL,
headers: {
'Content-Type': irpa_core.enums.request.content.xmlText,
'Accept': '*/*'
},
'body': XMLBody
};
return payload;
And I would remove the responseType: json.
Let me know if it helps.
Thanks a lot and best regards,
Baptiste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Baptiste,
I am the colleague of Jana.
I tested your suggestion and unfortunately, it didn't pass through.
Response error:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">Error in monitoring:
In my opinion we need a unique message ID placed in the header, something like:
<soapenv:Header>Only, is this possible in IRPA?
Kr,
Cedric
Hi baptiste_sa_sap ,
In postman it is working when using the postman variable "<wsa:messageId>urn:uuid:{{$randomUUID}}</wsa:messageId>"
This way, postman generates us a randomUUID which is needed. The rest of the body payload is identically the same. The only issue we have, is generating a random UUID as messsage ID. We are looking for a way to generate this Message ID in iRPA.
KR,
Jana
Hi @former_member17397, Your suggestion on the "headers" is working perfectly for my SoapWebservices. The posting happens perfectly now. Thanks for your suggestion!
User | Count |
---|---|
57 | |
11 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.