0

I'm attempting to use an API in ReadyAPI but it is not working for me. When I do the request via CURL it works fine. Any help would be appreciated.

Here is a sample of the format for the request via Curl, the end part is URL encoded:

curl -k -X POST https://myHost.test/999299/profile/SAML2/SOAP/https%3A%2F%2FmyHost.test-999299 -H 
"Content-Type: text/xml" -d '{
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        body
    </S:Body>
</S:Envelope>
}' 

This returns the proper response that I expect. However when I use this in SoapUI and enter a new REST service from URL it removed the URL encoding and forms a request like this:

POST https://myHost.test/999299/profile/SAML2/SOAP/https://myHost.test-999299 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml
Content-Length: 555
Host: myHost.test
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        body
    </S:Body>
</S:Envelope>

This request returns a 404 Not Found. Not sure if the URL encoding matters, but when i add it back manually it gives me an internal server error. What am I missing in the soapui Request.

DAC
  • 231
  • 4
  • 12

2 Answers2

0

Turned out that I needed to:

  1. Change the Resource string back to the URL encoded string https%3A%2F%2FmyHost.test-999299

  2. Had to wrap my body in brackets, remove spaces, line breaks etc. And that gave me a proper response.

{<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body>body</S:Body></S:Envelope>}
DAC
  • 231
  • 4
  • 12
0

In case anyone else stumples into this: for me it was company's proxy settings, "localhost" didn't work but "127.0.0.1" worked beautifully.

Antti Sulanto
  • 201
  • 2
  • 4