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

Problems with JAX-RPC

Expand Messages
  • Michael Santos
    I m trying to get a SOAP::Lite client to communicate with a JAX-RPC server. Simple types work as expected; however, passing complex types return a bunch of
    Message 1 of 1 , Jul 24 8:44 AM
    • 0 Attachment
      I'm trying to get a SOAP::Lite client to communicate with a JAX-RPC
      server.

      Simple types work as expected; however, passing complex types return
      a bunch of null values (without a SOAP fault). The SOAP::Lite client
      appears to pass identical XML as the java client, except the java
      client embeds the complex type as an href. Since both a java and
      ASP client are working, it looks as if it's a problem on my side.

      JAX appears to be a bit picky about the XML sent; for example,
      setting the xmlns attr for some of the complex types results in a
      SOAP fault.

      Can anybody spot what I'm doing wrong? Any suggestions would be
      appreciated. Apologies for the length of the post.

      Thanks!
      --
      Michael Santos
      mike@...


      XML sent by Java client:

      --cut
      <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns0="http://hello.org/financial/wsdl"
      xmlns:ns1="http://hello.org/financial/types"
      env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <env:Body>
      <ns0:CreditPurchase>
      <FGSID_1 href="#ID1"/>
      <int_2 xsi:type="xsd:int">0</int_2>
      <int_3 xsi:type="xsd:int">2</int_3>
      <String_4 xsi:type="xsd:string">4550011111111111=0506</String_4>
      <String_5 xsi:type="xsd:string">1.00</String_5>
      <String_6 xsi:type="xsd:string"></String_6>
      <String_7 xsi:type="xsd:string"></String_7>
      <String_8 xsi:type="xsd:string"></String_8>
      <int_9 xsi:type="xsd:int">0</int_9>
      <String_10 xsi:type="xsd:string"></String_10>
      <int_11 xsi:type="xsd:int">0</int_11>
      <String_12 xsi:type="xsd:string"></String_12>
      <String_13 xsi:type="xsd:string"></String_13>
      </ns0:CreditPurchase>
      <ns1:FGSID id="ID1" xsi:type="ns1:FGSID">
      <DLA xsi:type="xsd:string">t1111x</DLA>
      <seqNo xsi:type="xsd:int">1</seqNo>
      <MISTBID xsi:type="xsd:int">20628001</MISTBID>
      </ns1:FGSID>
      </env:Body></env:Envelope>
      --cut

      And the XML sent by the SOAP::Lite client:

      --cut
      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:namesp3="http://hello.org/financial/types"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <SOAP-ENV:Body>
      <namesp2:CreditPurchase xmlns:namesp2="http://hello.org/financial/wsdl">
      <FGSID_1 xsi:type="namesp3:FGSID">
      <DLA xsi:type="xsd:string">t1111x</DLA>
      <seqNo xsi:type="xsd:int">12</seqNo>
      <MISTBID xsi:type="xsd:int">20724003</MISTBID>
      </FGSID_1>
      <int_2 xsi:type="xsd:int">0</int_2>
      <int_3 xsi:type="xsd:int">2</int_3>
      <String_4 xsi:type="xsd:string">36438999960016=0506</String_4>
      <String_5 xsi:type="xsd:string">100</String_5>
      <String_6 xsi:type="xsd:string"/>
      <String_7 xsi:type="xsd:string">100</String_7>
      <String_8 xsi:type="xsd:string">123</String_8>
      <int_9 xsi:type="xsd:int">0</int_9>
      <String_10 xsi:type="xsd:string"/>
      <int_11 xsi:type="xsd:int">0</int_11>
      <String_12 xsi:type="xsd:string"/>
      <String_13 xsi:type="xsd:string"/>
      </namesp2:CreditPurchase>
      </SOAP-ENV:Body></SOAP-ENV:Envelope>
      --cut

      Perl excerpt:

      --cut
      my $fgsid = SOAP::Data->type('FGSID')->name(
      FGSID_1 => \SOAP::Data->value(
      SOAP::Data->type('xsd:string')->name(DLA => "t1111x"),
      SOAP::Data->type('xsd:int')->name(seqNo => 14),
      SOAP::Data->type('xsd:int')->name(MISTBID => 20724003))
      );

      my @params = (
      SOAP::Data->name('int_2')->type('xsd:int')->value(0),
      SOAP::Data->name('int_3')->type('xsd:int')->value(2),
      SOAP::Data->name('String_4')->type('xsd:string')->value("36438999960016=0506"),
      SOAP::Data->name('String_5')->type('xsd:string')->value("100"),
      SOAP::Data->name('String_6')->type('xsd:string')->value(""),
      SOAP::Data->name('String_7')->type('xsd:string')->value("100"),
      SOAP::Data->name('String_8')->type('xsd:string')->value("123"),
      SOAP::Data->name('int_9')->type('xsd:int')->value(0),
      SOAP::Data->name('String_10')->type('xsd:string')->value(""),
      SOAP::Data->name('int_11')->type('xsd:int')->value(0),
      SOAP::Data->name('String_12')->type('xsd:string')->value(""),
      SOAP::Data->name('String_13')->type('xsd:string')->value("")
      );

      my $fin = SOAP::Lite
      -> uri("http://hello.org/financial/wsdl")
      -> proxy('http://my.proxy.hello.org/')
      -> xmlschema(2001)
      -> maptype({FGSID => "http://hello.org/financial/types"})
      -> on_action(sub {sprintf(q(""));})
      -> CreditPurchase($fgsid, @params);
      --cut
    Your message has been successfully submitted and would be delivered to recipients shortly.