Loading ...
Sorry, an error occurred while loading the content.

SOAP::Lite perl client to .Net service resutls in null method args - help please

Expand Messages
  • testoutput
    I m trying to connect a SOAP::Lite perl client to a .Net service and pass arguments to one of the service methods. By all indications the call succeeds; I get
    Message 1 of 1 , May 4, 2007
    View Source
    • 0 Attachment
      I'm trying to connect a SOAP::Lite perl client to a .Net service and
      pass arguments to one of the service methods.

      By all indications the call succeeds; I get output returned from the
      method. However, the argument passed to the method ends up null. I
      have tried numerous different contortions of the code following
      examples I've found on the web for passing parameters, yet I
      continuously get the same result.

      I've included the simple perl test script, a simple VB .Net test
      method, the service description and the trace debug output of the
      script execution. I'm running the script from an XP machine and the
      web server is on our local network. I would appreciate any insight
      members of the group could provided.

      ---------------------------------------------------------

      Perl SCRIPT:

      use strict;
      use SOAP::Lite (+trace => 'debug', maptype => {});

      my $file;

      $file = 'test.txt';

      my $soap = SOAP::Lite
      -> uri('http://win2k03-r2-test/mwfilexfer')
      -> proxy('http://win2k03-r2-test/mwfilexfer/service.asmx')
      -> on_action(sub { join '/', 'http://win2k03-r2-test/mwfilexfer',
      $_[1] } );

      my $method = SOAP::Data->name('MarvinFileXfer')
      ->attr({xmlns =>'http://win2k03-r2-test/mwfilexfer/'});

      my $params = SOAP::Data->name('docname')
      ->value($file)
      ->type('string')
      ->uri('http://win2k03-r2-test/mwfilexfer');

      print "\n",$soap->call($method => $params)->result,"\n";

      ----------------------------------------------------

      VB .Net CODE:

      <WebMethod()> _

      Function MarvinFileXfer(ByVal docname As String) As String
      Dim s As String = docname
      Return "docname: " & docname
      End Function 'SaveDocument


      -------------------------------------------------------

      Service Description:

      MarvinFileXfer

      Test
      The test form is only available for requests from the local machine.
      SOAP 1.1

      The following is a sample SOAP 1.1 request and response. The
      placeholders shown need to be replaced with actual values.

      POST /mwfilexfer/service.asmx HTTP/1.1
      Host: win2k03-r2-test
      Content-Type: text/xml; charset=utf-8
      Content-Length: length
      SOAPAction: "http://win2k03-r2-test/mwfilexfer/MarvinFileXfer"

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <MarvinFileXfer xmlns="http://win2k03-r2-test/mwfilexfer">
      <docname>string</docname>
      </MarvinFileXfer>
      </soap:Body>
      </soap:Envelope>

      HTTP/1.1 200 OK
      Content-Type: text/xml; charset=utf-8
      Content-Length: length

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <MarvinFileXferResponse xmlns="http://win2k03-r2-test/mwfilexfer">
      <MarvinFileXferResult>string</MarvinFileXferResult>
      </MarvinFileXferResponse>
      </soap:Body>
      </soap:Envelope>

      -----------------------------------------------------------

      Result Output:

      SOAP::Transport::HTTP::Client::send_receive: POST
      http://win2k03-r2-test/mwfilexfer/service.asmx
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 583
      Content-Type: text/xml; charset=utf-8
      SOAPAction: http://win2k03-r2-test/mwfilexfer/MarvinFileXfer

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body>
      <MarvinFileXfer xmlns="http://win2k03-r2-test/mwfilexfer/">
      <namesp1:docname
      xmlns:namesp1="http://win2k03-r2-test/mwfilexfer"
      xsi:type="xsd:string">test.txt</namesp1:docname>
      </MarvinFileXfer>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Cache-Control: private, max-age=0
      Date: Fri, 04 May 2007 14:17:25 GMT
      Server: Microsoft-IIS/6.0
      Content-Length: 391
      Content-Type: text/xml; charset=utf-8
      Client-Date: Fri, 04 May 2007 14:17:25 GMT
      Client-Peer: 10.1.49.70:80
      Client-Response-Num: 1
      MicrosoftOfficeWebServer: 5.0_Pub
      X-AspNet-Version: 2.0.50727
      X-Powered-By: ASP.NET

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <MarvinFileXferResponse xmlns="http://win2k03-r2-test/mwfilexfer">
      <MarvinFileXferResult>docname: </MarvinFileXferResult>
      </MarvinFileXferResponse>
      </soap:Body>
      </soap:Envelope>

      docname:



      Thanks,
      Paul
    Your message has been successfully submitted and would be delivered to recipients shortly.