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

Problem passing value for 'ArrayOfString' varible

Expand Messages
  • madhan1m
    Hi All, I has been trying to access CA unicenter webservices using SOAP::Lite to connect axis webserver and calling getObjectValues but it looks like it
    Message 1 of 1 , Jun 29, 2006
    • 0 Attachment
      Hi All,

      I has been trying to access CA unicenter webservices using SOAP::Lite
      to connect axis webserver and calling 'getObjectValues' but it looks
      like it fails properly serialize 'attributes' variable of
      'ArrayOfString' type so that axis server can get it correctly. Script
      works fine for array @attr is empty. Please let me know if there is
      something in 'attributes' serialization or any other place and how
      axis server expects value for 'ArrayOfString' type variable. Your help
      is greatly appreciated.

      ---------- script ----------

      use SOAP::Lite;

      my $service = SOAP::Lite
      ->proxy('http://<IP>/axis/services/USD_R11_WebService')
      ->uri('/axis/services/USD_R11_WebService');

      my ($sid, $obj_hdl, @attr ) = ( 345455623, 'cr:345455', 'summary',
      'description' );

      my $objval_o = $service->getObjectValues(
      SOAP::Data->type('int')->name(sid => $sid),
      SOAP::Data->type('string')->name('objectHandle' => $obj_hdl ),
      SOAP::Data->name( attribues => [ map
      {SOAP::Data->name(item => $_)->type('string')} @attr ] ) );

      if ( $objval_o->fault ) {
      die "ERROR getObjectValues :".join(', ',$objval_o->faultcode,
      $objval_o->faultstring)."\n";
      }

      --------- SOAP Message Generated from above script ----------

      Content-Length: 714
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "/axis/services/USD_R11_WebService#getObjectValues"

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getObjectValues
      xmlns="/axis/services/USD_R11_WebService"><sid
      xsi:type="xsd:int">2103439759</sid><objectHandle
      xsi:type="xsd:string">cr:425329</objectHandle><attribues
      soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array"><item
      xsi:type="xsd:string">summary</item><item
      xsi:type="xsd:string">description</item></attribues></getObjectValues>
      </soap:Body></soap:Envelope>

      --------------------- SOAP Fault returned --------------------

      SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x833fe4)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      Server Error
      Connection: close
      Date: Thu, 29 Jun 2006 16:41:28 GMT
      Server: Apache-Coyote/1.1
      Content-Type: text/xml;charset=utf-8
      Client-Date: Thu, 29 Jun 2006 16:41:28 GMT
      Client-Peer: 10.17.94.161:8080
      Client-Response-Num: 1

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: Bad types (class
      [Ljava.lang.Object; -> class usdjws65.ArrayOfString)</faultstring>
      <detail/>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>

      ERROR getObjectValues :soapenv:Server.userException,
      org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; ->
      class usdjws65.ArrayOfString)

      -------------------------------

      ------------- Part of .wsdl file (not used in script)---------------

      ....
      - <complexType name="ArrayOfString">
      - <sequence>
      <element maxOccurs="unbounded" name="string" nillable="true"
      type="xsd:string" />
      </sequence>
      </complexType>
      ....

      - <element name="getObjectValues">
      - <complexType>
      - <sequence>
      <element name="sid" type="xsd:int" />
      <element name="objectHandle" type="xsd:string" />
      <element name="attributes" type="impl:ArrayOfString" />
      </sequence>
      </complexType>
      </element>
      ....
      - <wsdl:message name="getObjectValuesRequest">
      <wsdl:part element="impl:getObjectValues" name="parameters" />
      </wsdl:message>
      -
      ....
      - <wsdl:operation name="getObjectValues" parameterOrder="">
      <wsdl:input message="impl:getObjectValuesRequest"
      name="getObjectValuesRequest" />
      <wsdl:output message="impl:getObjectValuesResponse"
      name="getObjectValuesResponse" />
      </wsdl:operation>

      .....

      - <wsdl:operation name="getObjectValues">
      <wsdlsoap:operation soapAction="" />
      - <wsdl:input name="getObjectValuesRequest">
      <wsdlsoap:body
      namespace="http://www.ca.com/UnicenterServicePlus/ServiceDesk"
      use="literal" />
      </wsdl:input>
      - <wsdl:output name="getObjectValuesResponse">
      <wsdlsoap:body
      namespace="http://www.ca.com/UnicenterServicePlus/ServiceDesk"
      use="literal" />
      </wsdl:output>
      </wsdl:operation>

      ---------------------------
      Please let me know if you any other information

      Thanks,
      Madhan
    Your message has been successfully submitted and would be delivered to recipients shortly.