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

Newbie Question: Datatype/namespaces

Expand Messages
  • greenishmarsian
    I m in trouble with sending information to a server. In the wsdl file I use, definition of method is: -
    Message 1 of 2 , Nov 4, 2003
    • 0 Attachment
      I'm in trouble with sending information to a server.

      In the wsdl file I use, definition of method is:

      - <wsdl:message name="getResearchListRequest">
      <wsdl:part name="name0" type="xsd:string" />
      <wsdl:part name="name1" type="tns2:ArrayOffString" />
      <wsdl:part name="name2" type="tns2:ArrayOffint" />
      <wsdl:part name="name3" type="tns2:ArrayOffString" />


      I'm sending request:


      #!/usr/local/bin/perl

      use SOAP::Lite;

      my $svc = SOAP::Lite-> service('http://......');
      my $resp1 = $svc-> getResearchList (
      SOAP::Data->name ('research_list') -> value ([
      SOAP::Data->name(item0=>'xxx') -> type ('string'),
      SOAP::Data->name(item1=>'111111') -> type ('string'),
      SOAP::Data->name(item2=>'111') -> type ('int'),
      SOAP::Data->name(item3=>'xx') -> type ('string')
      ]));


      But server returns an error:

      <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: Bad types (class
      [Ljava.lang.Object; -> class java.lang.String)</faultstring>
      <detail/>
      </soapenv:Fault>

      I don't know what datatype should I use
    • Byrne Reese
      It looks to me like you need to encode an array, which is not done as you might expect in SOAP::Lite. You need to create a data structure like this:
      Message 2 of 2 , Nov 4, 2003
      • 0 Attachment
        It looks to me like you need to encode an array, which is not done as you
        might expect in SOAP::Lite.

        You need to create a data structure like this:

        <getResearchList>
        <name0></name0>
        <name1>
        <item>
        <foo />
        <bar />
        </item>
        </name1>
        ...
        </getResearchList>


        I am pretty sure the following code will produce that structure:

        $client->getResearchList(
        SOAP::Data->name('name0' => 'abcd'),
        SOAP::Data->name('name1' => \SOAP::Data->value(
        SOAP::Data->name('item' => \SOAP::Data->value(
        SOAP::Data->name('foo' => '123'),
        SOAP::Data->name('bar' => '456')
        )
        )
        )

        If I am wrong let me know.


        >
        >
        >
        >
        >
        > I'm in trouble with sending information to a server.
        >
        > In the wsdl file I use, definition of method is:
        >
        > - >;wsdl:message name="getResearchListRequest"
        > >;wsdl:part name="name0" type="xsd:string" /
        > >;wsdl:part name="name1" type="tns2:ArrayOffString"
        > /
        > >;wsdl:part name="name2" type="tns2:ArrayOffint" /
        > >;wsdl:part name="name3" type="tns2:ArrayOffString"
        > /
        >
        >
        > I'm sending request:
        >
        >
        > #!/usr/local/bin/perl
        >
        > use SOAP::Lite;
        >
        > my $svc = SOAP::Lite-http://......');
        > my $resp1 = $svc-
        > SOAP::Data-
        > SOAP::Data-
        > SOAP::Data-
        > SOAP::Data-
        > SOAP::Data-
        > ]));
        >
        >
        > But server returns an error:
        >
        >>;soapenv:Fault
        > >;faultcode;/faultcode
        > >;faultstring
        > [Ljava.lang.Object; -&gt; class java.lang.String)>;/faultstring
        > >;detail/
        > >;/soapenv:Fault
        >
        > I don't know what datatype should I use
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Sponsor
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        >
        >
        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        >
        >
        >
        >
        >


        ^byrne :/
      Your message has been successfully submitted and would be delivered to recipients shortly.