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


In reply to SOAP::Lite WSDL request (Strawberry Perl to IIS 6.1) by stevieb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.