cancel
Showing results for 
Search instead for 
Did you mean: 

Get SOAP data using HTTP Request

NickiKristensen
Level 4
Hi all,

I'm trying to utilize a SOAP based Web API, using the HTTP Request action.
Unfortunately it's not possible to use the Web Services directly.

I can get the data I want by using the cURL command below - some data are redacted:
curl -X POST -H "Content-Type: text/xml" -H 'SOAPAction: "http://www.website.tld/2019/01/api/IHelloApiV1/SayHello"' --data-binary @request.xml https://www.website.tld/website/943/api/hello/v1?wsdl --user username:password.
The contents of the request.xml file is as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://www.website.tld/2019/01/api">
   <soapenv:Header/>
      <soapenv:Body>
         <api:SayHello>
            <api:name>Nicki</api:name>
         </api:SayHello>
      </soapenv:Body>
</soapenv:Envelope>

In Blue Prism, I have configured the HTTP Request action like this:
13308.png
However, I do recieve this error:
"The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)"

My guess would be something with the SOAPAction part of the cURL command, missing in Blue Prism, but I'm not by any means an SOAP expert 😉

Can anyone spot my mistake? 



------------------------------
Nicki Kristensen
RPA Developer
IBC International Business College
------------------------------
1 REPLY 1

Hi, Nicki,

I created my own C# implementation of HTTP Request which I have fully under my control and I can do whatever I want. Are you familiar with C#? If you want to help you can contact me privately and we can sort it out.

The initialization of webrequest is like this (and you can see SOAPAction parameter which was crucial in my integration with IBM Content Manager)

public static System.Net.HttpWebRequest CreateWebRequest(string url)
{
      System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);    
      webRequest.Headers.Add("SOAPAction","");   
      webRequest.ContentType = "text/xml;charset=\"utf-8\"";   
      webRequest.Accept = "text/xml";   
      webRequest.Method = "POST";   
      return webRequest;
}

Regards,

Zdenek

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
Europe/Prague
------------------------------