DATA Step, Macro, Functions and more

PROC SOAP

Reply
Occasional Contributor
Posts: 8

PROC SOAP

Hey. 

 

I have been struggling with this code for some days now. I read all posts in community, tried to google but still not able to solve my problem. 

 

I get this error message. I understand that i need to fix encoding but i'm not sure what and where i shoud put it. 

 

ERROR: org.springframework.ws.client.WebServiceTransportException: Cannot process the message
because the content type 'text/xml; charset=UTF-8' was not the expected type
'application/soap+xml; charset=utf-8'. [415]

 

This my code:

FILENAME request 'D:\Admin\Request.xml';
FILENAME response 'D:\Admin\Response.xml';

proc soap in=request
out=response
url="url.svc"
soapaction='GetLoanCaseByReferenceNumber'
debug="D:\Admin\soap.txt"
;
run;

 

and this is my request.xml

<?xml version="1.0"?>

-<soap:Envelope soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding" xmlns:soap="http://www.w3.org/2001/12/soap-envelope">

<soap:Header/>


-<soap:Body xmlns:tem="http://tempuri.org/">


-<tem:GetLoanCaseByReferenceNumber>

<tem:referenceNumber>?</tem:referenceNumber>

</tem:GetLoanCaseByReferenceNumber>

</soap:Body>

</soap:Envelope>

 

Did somebody have the same problem and how it was solved? I found an article but it was more java related. 

PROC Star
Posts: 2,339

Re: PROC SOAP

[ Edited ]

@ArvAmundson seems to have experience with proc soap, so I tag him here.

@MagnusGustavsson too.

Good luck.

 

New Contributor
Posts: 3

Re: PROC SOAP

I haven't seen this error.  However, the "charset=UTF-8" would indicate to me that the request file was most likely created in a Unix environment.  What OS is the service running on?

 

You could try saving your request file in Windows encoding and then try submitting again.  Then see what happens.

 

I have not used the "encodingStyle=" parameter in any of my SOAP calls.

 

Have you tried testing this with SOAPUI?  Read in the WSDL in SOAPUI and see what it gives you for the xml request layout.

Occasional Contributor
Posts: 8

Re: PROC SOAP

Posted in reply to ArvAmundson

Hi and thanks for reply.

 

I'm running on Windows platform and is using UTF-8 encoding. Yes, code works fine i SOAPUI. SAS mean that there is a mismatch beetween SOAP server and SOAP receiver.

 

But another problem is that we are using NTML and it doesn't supported by PROC SOAP, so i need to find another way to get data from the WSDL, like PROC HTTP.

Ask a Question
Discussion stats
  • 3 replies
  • 287 views
  • 1 like
  • 3 in conversation