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

Creating client SOAP request with not too complex structure

Expand Messages
  • B
    Hi, how can I create the following request with SOAP::Lite? ...
    Message 1 of 2 , Mar 17 12:13 PM
    • 0 Attachment
      Hi, how can I create the following request with SOAP::Lite?

      ...
      <SOAP-ENV:Body>
      <m:getAvailableFieldNames xmlns:m="v2"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <reportOptions xsi:type="m0:ReportOptions">
      <dataSource xsi:type="xsd:string">MyDataSourceString</dataSource>
      </reportOptions>
      </m:getAvailableFieldNames>
      </SOAP-ENV:Body>
      ...

      My attempt (that fails) is:
      my $fields = SOAP::Lite
      -> service ("http://$server/services/v2/$wsdl")
      -> getAvailableFieldNames( SOAP::Data->name(dataSource => "$ds") ) ;

      which produces:
      ...
      <SOAP-ENV:Body>
      <namesp1:getAvailableFieldNames xmlns:namesp1="v2">
      <dataSource xsi:type="xsd:string">MyDataSourceString</dataSource>
      </namesp1:getAvailableFieldNames>
      </SOAP-ENV:Body></SOAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive:
      HTTP::Response=HASH(0x2b0f574)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      Server Error

      I've read lots of SOAP::Lite documentation etc, but can't seem to
      figure out how to use more complex objects...

      Any help appreciated,
      Bjorn
    • bjorn_svensson
      The answer - getAvailableFieldNames(SOAP::Data- name( reportOptions = SOAP::Data- name( dataSource = $ds))) was found at
      Message 2 of 2 , Mar 17 3:28 PM
      • 0 Attachment
        The answer

        -> getAvailableFieldNames(SOAP::Data->name("reportOptions" =>
        \SOAP::Data->name("dataSource" => $ds)))

        was found at
        http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread

        A great how-to for creating complex objects. Maybe the link will help
        more people...



        --- In soaplite@yahoogroups.com, "B" wrote:
        > Hi, how can I create the following request with SOAP::Lite?
        >
        > ...
        > <m:getAvailableFieldNames xmlns:m="v2"
        > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        > <reportOptions xsi:type="m0:ReportOptions">
        > <dataSource
        xsi:type="xsd:string">MyDataSourceString</dataSource>
        > </reportOptions>
        > </m:getAvailableFieldNames>
        > ...
        > My attempt (that fails) is:
        > my $fields = SOAP::Lite
        > -> service ("http://$server/services/v2/$wsdl")
        > -> getAvailableFieldNames( SOAP::Data->name(dataSource => "$ds") ) ;
        ...
      Your message has been successfully submitted and would be delivered to recipients shortly.