Transitioning from to

Due to httpPost() being deprecated in the future I’m attempting to transition a working SOAP interface to httpClient() as suggested in a number of discussions. I attempted to view differences in the frame on the wire and found that my post isn’t making it to the wire due to http error 415 “Unsupported Media Type”. All my headers seem to be the same and body is absolutely the same. Not quite sure what attributes would cause the 415 now that I’m using httpClient(). There weren’t any SOAP based examples that I could find using the function.

My data element is an XML string. If I eliminate the data element the request goes out on the wire but obviously fails with no payload. So I’m assuming there is something wrong with my method of identifying the content-type.

dataservice = 'http://cwa112300q:50211/TTPMESWS'

soapenv = """<soapenv:Envelope xmlns:soapenv="" xmlns:urn="">
         <Description>KRD Material 302</Description>
            <Description>Product 302</Description>

myheaders = {
        'SOAPAction': 'SetMaterial',
        'Context-type' : 'text/xml;charset=UTF-8'

	client =
	response =,headers=myheaders,data=soapenv,username=user,password=pwd)

Should probably be Content-type, no?

I wish those trees would get out of the way so I could see the forest. Sigh…
Good catch. Don’t know how I managed that.
Thank you!

1 Like