Tardigrade4 has asked for the wisdom of the Perl Monks concerning the following question:

My SOAP::Lite gets a faultcode "Part content ID cannot be blank for non root MIME parts" when I do plain-vanilla SOAP attachments:

my $packager = SOAP::Lite::Packager::MIME->new; my $cmdService = SOAP::Lite ->packager($packager) ->parts([$entity]) ->uri($cmdNamespace) ->proxy($cmdEndpoint); my $cmdResponse = $cmdService->call( @argumentList

I saw a web page that suggests that Axis2 always gives this error when someone forgets that line terminations are \r\n and not just \n. My HTTP message looks about right, but I cannot see the missing \r-s, of course. I posted this at the end (company name changed, and the problem is not the encoding.)

Is there a problem with the code? Or is there a problem with SOAP::Lite::Packager? I looked at Entity.pm and I see lots of \n and not a single \r\n.

SOAP::Transport::HTTP::Client::send_receive: POST https://localhost:98 +43/services/CLITunnelService HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 1664 Content-Type: Multipart/Related; type="text/xml"; start="<main_envelop +e>"; boundary="----------=_1257541705-5420-0"; charset=utf-8 SOAPAction: "http://mycompanyname.com/webservices/skeleton/clitunnel#e +xecuteCommandUsingAttachments" This is a multi-part message in MIME format... ------------=_1257541705-5420-0 Content-Type: text/xml Content-Disposition: inline Content-Location: /main_envelope Content-ID: <main_envelope> <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:/ +/www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xm +lsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema +" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmln +s:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ns1: +sessionId xsi:type="xsd:anyURI" xmlns:ns1="http://mycompanyname.com/w +ebservices/framework/xsd">urn:uuid:F72A714A5C6621242B1257541698211</n +s1:sessionId></soap:Header><soap:Body><ns6:executeCommandUsingAttachm +ents xmlns:ns6="http://mycompanyname.com/webservices/skeleton/clitunn +el"><ns6:nameSpace xsi:type="xsd:string">Server</ns6:nameSpace><ns6:c +ommandName xsi:type="xsd:string">bulkAddServers</ns6:commandName><ns6 +:commandArguments xsi:type="xsd:string">C:/temp</ns6:commandArguments +><ns6:commandArguments xsi:type="xsd:string">servers.csv</ns6:command +Arguments><ns6:commandArguments xsi:type="xsd:string">UTF-8</ns6:comm +andArguments><ns6:commandArguments xsi:type="xsd:boolean">false</ns6: +commandArguments></ns6:executeCommandUsingAttachments></soap:Body></s +oap:Envelope> ------------=_1257541705-5420-0 Content-Type: text/plain; name="C:\temp\servers.txt" Content-Disposition: attachment; filename="C:\temp\servers.txt" MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) Content-Location: /cid_0 Content-ID: <cid_0> Content-Transfer-Encoding: base64 TmFtZQphMTcKCgoKCgoKCg== ------------=_1257541705-5420-0--

Replies are listed 'Best First'.
Re: SOAP::Lite::Packager and bad Content-ID
by Anonymous Monk on Nov 06, 2009 at 22:58 UTC

      I think there is no MTOM but Axis2 will support SOAP with attachments automatically. Please let us focus on the thread question "bad Content-UD".

      I am trying to install Perl 5.10.1 on a Linux machine to see if this is a platform specific bug. This is going badly. SOAP::Lite won't install, as LWP won't install, because URI won't install.

      Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get "http://www.perl.org/CPAN/authors/id/G/GA/GAAS/URI-1.40.tar.gz" curl: (22) The requested URL returned error: 502 Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http: +//www.perl.org/CPAN/authors/id/G/GA/GAAS/URI-1.40.tar.gz" > /root/.c +pan/sources/authors/id/G/GA/GAAS/URI-1.40.tar.tmp1885") returned status 22 (wstat 5632) Warning: expected file [/root/.cpan/sources/authors/id/G/GA/GAAS/URI-1 +.40.tar.gz.tmp1885] doesn't exist Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/id/G/GA/GAAS +/URI-1.40.tar.tmp1885" to get "http://www.perl.org/CPAN/authors/id/G/GA/GAAS/URI-1.40.tar.gz" --05:06:45-- http://www.perl.org/CPAN/authors/id/G/GA/GAAS/URI-1.40.t +ar.gz => `/root/.cpan/sources/authors/id/G/GA/GAAS/URI-1.40.tar.t +mp1885' Resolving www.perl.org... 207.171.7.63 Connecting to www.perl.org|207.171.7.63|:80... connected. HTTP request sent, awaiting response... 502 Bad Gateway 05:06:45 ERROR 502: Bad Gateway.
        SOAP with attachments in Perl have never worked against a server that is strict about HTTP. HTTP demands \r\n but I proved to myself by debugging Axis2 and Axiom that SOAP::Lite and MIME::Entity only generate a \n. This makes them useless a SOAP solution.