BookmarkSubscribeRSS Feed
irinaia
Obsidian | Level 7

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. 

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

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

@MagnusGustavsson too.

Good luck.

 

ArvAmundson
Calcite | Level 5

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.

irinaia
Obsidian | Level 7

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1826 views
  • 1 like
  • 3 in conversation