HTTP Error 415

Hi,

We are using SOAP Integration. On my system when I run pub.client:soapHTTP which doesn’t contain two inputs i.e., ContentType and loadAs. Whereas the other server which contains all the patches has these additional inputs ContentType and loadAs. Also the service pub.soap.utils:createSoapData has the enCoding field in on server and the other doesn’t have. Whichever server doesn’t have additional input is working fine. Whenever I run the webService I am getting the error:

header/status: 415
header/statusMessage: Unsupported Media Type

Can anyone please help on the same.

With Regards,
Navanee

The default content type is / was “text/xml”. I’m not sure what content type is provided by default for the newer service versions, but I would still expect that to be “text/xml”.

One thing to check, if you already had a variable in your pipeline called “contentType” but used for something else and didn’t drop it before calling the new version of pub.client:soapHTTP, you might be sending an unintended content-type.

Use a soap message capture tool to examine the message you are sending including the HTTP header properties. Also, talk with the publisher of the web service to see if they are expecting a specific content-type.

Does setting contentType to “text/xml” on the new service versions work or fail?

HTH,

Mark

Hi Mark,

Thanks for your response.

I have installed the wsdl for communicating with Navision System. When I checked it’s showing that it’s passing as "text/xml’ charset=“UTF-8"”. Nowhere it’s overwritten.

When I try workign this wsdl with the system where the patches are not applied, it’s working fine. When I put the wsdl where all the patches are applied, it’s throwing an error.

Can you please let me know on the same.

With Regards,
Navanee

Find out from your vendor what content-type they are expecting and set the contentType variable to that value.

Hi Marc,

When it’s working the system where no patches are applied, why is it not working with the system with all updated patches. One webMethods server with no patch is able to communicate and get the response properly. But the Development server which has all the patches is saying this error. Will there be anything with the patches?

With Regards,
Navanee

The patches added two parameters to the pub.client:soapHTTP built-in service one of which is content-type. Your error is related to contentType. Without knowing what content-type your vendor is expecting and is actually receiving, I can’t begin to tell you why the old version works and the new one does not, but my guess is that if you capture one of the soap requests you are sending that works and capture one you are sending that fails and compare them you will see a different contentType being sent.

I’m not going to guess any futher on this issue. Capture the actual messages you are sending and compare the content types. If you can’t or won’t do this find someone who can or will.

Mark

Hi mark,

Below is the Header & Body that are created with the older version which gives the response from the end system as expected

Header:

Mozilla/4.0 [en] (WinNT; I)
image/gif, /
amshqc-navdev01
Basic Og==
text/xml
TopDomainer Search Engine
933
</HTTPHeaders

Body
[FONT=Arial][SIZE=2][FONT=Arial]<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“http://www.w3.org/1999/XMLSchema” xmlns:xsi=“http://www.w3.org/1999/XMLSchema-instance” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>
SOAP-ENV:Body
<tns1:InvoiceOnHold xmlns:tns1=“TopDomainer Search Engine”>
tns1:customer_number10054</tns1:customer_number>
tns1:document_numberGJ05000021</tns1:document_number>
tns1:document_type2</tns1:document_type>
tns1:promised_to_pay_date2006-11-17</tns1:promised_to_pay_date>
tns1:requesting_userErik</tns1:requesting_user>
tns1:company_nameTest</tns1:company_name>
<tns1:case_number />
tns1:descriptionlocal</tns1:description>
<tns1: onhold>true</tns1: onhold>
</tns1:InvoiceOnHold>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Below is the Header & Body that are created with the newer version which gives the response as 415 Unsupported Media type

Header

[FONT=Verdana][SIZE=2][FONT=Arial]
Mozilla/4.0 [en] (WinNT; I)
image/gif, /
amshqc-navdev01
Basic Og==
text/xml’ charset=“UTF-8”
TopDomainer Search Engine
867

Body

[FONT=Arial][SIZE=2][FONT=Arial]<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
- SOAP-ENV:Body
- <tns1:InvoiceOnHold xmlns:tns1=“TopDomainer Search Engine”>
tns1:customer_number10054</tns1:customer_number>
tns1:document_numberGJ05000021</tns1:document_number>
tns1:document_type2</tns1:document_type>
tns1:promised_to_pay_date2006-11-17</tns1:promised_to_pay_date>
tns1:requesting_userErik</tns1:requesting_user>
tns1:company_nameTest</tns1:company_name>
<tns1:case_number />
tns1:descriptionserver</tns1:description>
tns1:onholdtrue</tns1:onhold>
</tns1:InvoiceOnHold>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

If we compare both header xml’s, it’s clear that it’s the problem of the content type. But we don’t understand how to change the value of the content type in the version as it overwrites any content that we pass with text/xml’ charset=“UTF-8”.

Please let me know what may be the reason for the same.

With Regards,
Navanee
[/FONT][/SIZE][/FONT][/FONT][/SIZE][/FONT][/FONT][/SIZE][/FONT]

Now we are getting somewhere…

If you set the content-type to “text/xml” without the quotes , what happens?

If this still produces the same behavior, I would log a new Service Request with webMethods Support. You might also check the Advantage “known fixes” area for your IS release to see if there have been related fixes.

Mark

Hi Marc,

Thanks for your reply.

Even if I set the content type using the Pick box list, it’s showing the content type as "text/xml’ charset=“UTF-8” ". If we watch closely, you can see a single codes “’” after text/xml. Hopefully, it’s the error on webMethods fix. Not sure about it.

Is my understanding right?

With Regards,
Navanee

I just tested this using IS 6.5 with a variety of fixes applied and did not have the “content-type” issue.

Here’s my sample SOAP request including the HTTP properties. I picked the “text/xml” value from the drop down list.

POST /soap/default HTTP/1.0
User-Agent: Mozilla/4.0 [en] (WinNT; I)
Accept: image/gif, */*
Host: 127.0.0.1:4003
Authorization: Basic QU=
Content-type: text/xml
SOAPAction: ""
Content-Length: 456

[highlight=xml]

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
SOAP-ENV:Body
<demo:myDoc xmlns:demo=“urn:mynamespace”>
2006-05-03T14:27:12.123-06:00
100.00
</demo:myDoc></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
[/highlight]

Hi Mark,

The environment on which I am working is 6.1.

With Regards,
Navanee

Contact support for a fix that will address this issue.

Thanks a lot Mark. We are in touch with webMethods support to get the fix

With Regards,
Navanee

Do you know the solution for this thread? we are facing the same issue in our environment while calling the client service over webService.

Thanks,
Anks