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

How to send SOAP hastable to server

Expand Messages
  • lmcmmaz
    Hi, My Perl Client application must send commands containing a Hastable and I cannot manage that. Simple commands are OK. The following command: use strict;
    Message 1 of 2 , Oct 18, 2002
    • 0 Attachment
      Hi,

      My Perl Client application must send commands containing
      a Hastable and I cannot manage that. Simple commands are OK.

      The following command:

      use strict;
      use SOAP::Lite;

      my $response = SOAP::Lite
      ->uri("urn:..:..")
      ->proxy("http://.....")
      ->createTR(
      SOAP::Data->name("userid" => "my_userid"),
      SOAP::Data->name("password" => "my_password"),
      SOAP::Data->name("createStatus" => "Private"),
      SOAP::Data->type('ordered_hash' => [
      SOAP::Data->name("TRType" => "ABC90"),
      SOAP::Data->name("heading" => "TR created
      with direct SOAP connection"),
      SOAP::Data->name("ISPCustomer" => "N"),
      SOAP::Data->name("countryCode" => " "),
      SOAP::Data->name("site" => " "),
      SOAP::Data->name("siteStatus" => " "),
      SOAP::Data->name("AS" => "ABC 111 00"),
      SOAP::Data->name("ASRState" => "R1")
      ]
      )
      );

      if( $response->fault ){
      print "An ERROR occurred while calling createTR:" .
      "\n- " . $response->fault .
      "\n- " . $response->faultstring .
      "\n- " . $response->faultdetail .
      "\n";
      exit(0);
      }

      print "Succeed";

      exit(0);


      Returns the error:
      An ERROR occurred while calling createTR:
      - HASH(0x45db40)
      - No Deserializer found to deserialize a ':c-gensym8' using encoding
      style 'http
      ://schemas.xmlsoap.org/soap/encoding/'.


      Any idea will be greatly appreciate,

      Thanks,

      Marc
    • Duncan Cameron
      ... I guess that your syntax for the ordered hash is incorrect. Something like this is probably what you want SOAP::Data- type( ordered_hash = [ TRType =
      Message 2 of 2 , Oct 19, 2002
      • 0 Attachment
        On 2002-10-19 lmcmmaz wrote:
        >Hi,
        >
        >My Perl Client application must send commands containing
        >a Hastable and I cannot manage that. Simple commands are OK.
        >
        >The following command:
        >
        >use strict;
        >use SOAP::Lite;
        >
        >my $response = SOAP::Lite
        > ->uri("urn:..:..")
        > ->proxy("http://.....")
        > ->createTR(
        > SOAP::Data->name("userid" => "my_userid"),
        > SOAP::Data->name("password" => "my_password"),
        > SOAP::Data->name("createStatus" => "Private"),
        > SOAP::Data->type('ordered_hash' => [
        > SOAP::Data->name("TRType" => "ABC90"),
        > SOAP::Data->name("heading" => "TR created
        >with direct SOAP connection"),
        > SOAP::Data->name("ISPCustomer" => "N"),
        > SOAP::Data->name("countryCode" => " "),
        > SOAP::Data->name("site" => " "),
        > SOAP::Data->name("siteStatus" => " "),
        > SOAP::Data->name("AS" => "ABC 111 00"),
        > SOAP::Data->name("ASRState" => "R1")
        > ]
        > )
        > );
        >
        >if( $response->fault ){
        > print "An ERROR occurred while calling createTR:" .
        > "\n- " . $response->fault .
        > "\n- " . $response->faultstring .
        > "\n- " . $response->faultdetail .
        > "\n";
        > exit(0);
        >}
        >
        >print "Succeed";
        >
        >exit(0);
        >
        >
        >Returns the error:
        >An ERROR occurred while calling createTR:
        >- HASH(0x45db40)
        >- No Deserializer found to deserialize a ':c-gensym8' using encoding
        >style 'http
        >://schemas.xmlsoap.org/soap/encoding/'.
        >
        >
        I guess that your syntax for the ordered hash is incorrect.
        Something like this is probably what you want

        SOAP::Data->type('ordered_hash' => [
        TRType => 'ABC90',
        heading => 'TR created with direct SOAP connection,
        # etc
        ]
        )

        Regards,
        Duncan Cameron
      Your message has been successfully submitted and would be delivered to recipients shortly.