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

Passing an object

Expand Messages
  • Gordon Pate
    I have two scripts that both hit a SOAP::Lite server. One uses straight soap calls while the other uses wsdl. The one that uses soap calls looks like this:
    Message 1 of 1 , Jul 6, 2004
    View Source
    • 0 Attachment
      I have two scripts that both hit a SOAP::Lite server. One uses
      straight soap calls while the other uses wsdl.

      The one that uses soap calls looks like this:
      #######################################################
      my $soap = SOAP::Lite
      -> uri('/EmployeeContactInfoServer')
      -> proxy('http://mysoapserver.com/soap/');
      my $result = $soap-> getObject($empNumber);

      ####get object here
      my $contactInfo = $result->result();
      ####pass object back to server
      my $empTxtInfoRequest = $soap->getEmpTxtInfo($contactInfo);
      my $empTxtInfo = $empTxtInfoRequest->result();
      print $empTxtInfo;

      ######################################################

      my wsdl version looks like this:
      ######################################################
      my $service = SOAP::Lite->
      service('http://mysoapserver.com/EmployeeContactInfo.wsdl');

      my $result = $service-> getObject($empNumber);

      my $info = $service-> getEmpTxtInfo("$result");


      print $stuff, " stuff\n";
      ##################################################

      The straight soap version works fine. I'm sure due to SOAP::Lite's
      auto typing. I think that my problem lies in how to declare the type
      for the input for getEmpTxtInfo in the wsdl file. If I set it to
      string, it literally sends the hash description string and not the
      actual object.

      In the wsdl file I have this line for the input value for getEmpTxtInfo:

      <message name="getEmpTxtInfoRequest">
      <part name="getEmpTxtInfoInput" type="xsd:string" />
      </message>


      Any help would be appreciated.
    Your message has been successfully submitted and would be delivered to recipients shortly.