stevieb has asked for the wisdom of the Perl Monks concerning the following question:
This is my first ever attempt at using a SOAP API, and I've spent most of yesterday and part of today trying to figure out this issue.
I can connect via my script to the server, but am getting "SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 415 Unsupported Media Type" as an error.
First thing I see is in the trace output:
Accept: application/soap
...a bit later in the same error:
Content-Type: application/soap+xml; charset=utf-8
... so I assume that is the problem. I've tried both of:
$SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE = 1; $SOAP::Constants::DO_NOT_USE_CHARSET = 1;
To no avail.
Might someone be able to point me to where I'm going wrong? I've searched all over but just can't figure out what exactly is wrong, nor can I find any more knobs to turn for testing.
Code:
use warnings; use strict; use SOAP::Lite +trace => 'debug'; my $wsdl = 'http://localhost/demo/idapi/wsdl'; my $soap = SOAP::Lite->service($wsdl); print $soap->UserclassList();
To verify that I'm connected correctly, I mistype the method name, and it returns a list of valid methods:
Unrecognized method 'BLAH'. List of available method(s): PSLStoreSet O +nboardManagedSystem UserclassPointCacheRecalculate ... etc
Here's the full error message:
SOAP::Transport::HTTP::Client::send_receive: POST http://localhost/dem +o/idapi HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 1115 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://www.example.com/idapi/Iidapi/UserclassList" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyl +e="http://schemas.xmlsoap.org/soap/encoding/" xmlns:msc="http://schem +as.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap="http://schemas +.xmlsoap.org/soap/envelope/" xmlns:soap12="http://schemas.xmlsoap.org +/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encodin +g/" xmlns:tns="http://www.example.com/idapi" xmlns:wsa="http://schema +s.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa10="http://www.w3.org/2 +005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/m +etadata" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing +/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns +:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xm +lsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/ws +s/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsx="htt +p://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsd="http://www.w3.org/ +2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +><soap:Body><tns:UserclassList xsi:nil="true" /></soap:Body></soap:En +velope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 415 Unsupported +Media Type Date: Tue, 05 Jul 2016 17:50:51 GMT Server: Microsoft-HTTPAPI/2.0 Content-Length: 468 Content-Type: application/soap+xml; charset=utf-8 Client-Date: Tue, 05 Jul 2016 17:50:51 GMT Client-Peer: ::1:80 Client-Response-Num: 1 <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="ht +tp://www.w3.org/2003/05/soap-envelope"><s:Header><a:Action s:mustUnde +rstand="1">http://schemas.microsoft.com/net/2007/09/windowswebservice +s/servicemodel/fault</a:Action></s:Header><s:Body><s:Fault><s:Code><s +:Value>s:Sender</s:Value></s:Code><s:Reason><s:Text xml:lang="en-US"> +The server was unable to process the request due to an internal error +.</s:Text></s:Reason></s:Fault></s:Body></s:Envelope>
Thanks all!
-stevieb
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOAP::Lite WSDL request (Strawberry Perl to IIS 6.1)
by Anonymous Monk on Jul 05, 2016 at 21:58 UTC |