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.
@ArvAmundson seems to have experience with proc soap, so I tag him here.
@MagnusGustavsson too.
Good luck.
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.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.