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

6371Complex data type

Expand Messages
  • pgfarr
    Aug 28, 2009
    • 0 Attachment
      I am trying to build a SOAP request with the following structure:
      <?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:ns="http://www.alarmpoint.com/webservices/schema" 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>
      <ns:AddGroup>
      <ns:user xsi:type="xsd:string">ws_user1</ns:user>
      <ns:password xsi:type="xsd:string">LetMeIn</ns:password>
      <ns:clientTimestamp />
      <ns:clientIP />
      <ns:clientOSUser />
      <ns:company xsi:type="xsd:string">Default Company</ns:company>

      <ns:group>
      <ns:active xsi:type="xsd:int">1</ns:active>
      <ns:allowDuplicates xsi:type="xsd:int">1</ns:allowDuplicates>
      <ns:description xsi:type="xsd:string">New group</ns:description>
      <ns:externallyOwned xsi:type="xsd:int">1</ns:externallyOwned>
      <ns:name xsi:type="xsd:string">Test Group</ns:name>
      <ns:observedByAll xsi:type="xsd:string" />
      <ns:observers xsi:type="xsd:string" />
      <ns:site xsi:type="xsd:string" />
      <ns:supervisors /><ns:timeZone xsi:type="xsd:string" />
      <ns:useDefaultDevices xsi:type="xsd:int">1</ns:useDefaultDevices>
      </ns:group>
      </ns:AddGroup>
      </soap:Body>
      </soap:Envelope>

      using the following code fragment:

      my $ap_response = $SOAP->call(
      SOAP::Data->name( 'ns:AddGroup' ) =>
      SOAP::Data->name( 'ns:user'=> $WS_USER),
      SOAP::Data->name( 'ns:password'=> $WS_PASSWD),
      SOAP::Data->name( 'ns:clientTimestamp'),
      SOAP::Data->name( 'ns:clientIP'),
      SOAP::Data->name( 'ns:clientOSUser'),
      SOAP::Data->name( 'ns:company'=> $COMPANY),
      SOAP::Data->name( 'ns:group' ) =>
      SOAP::Data->name( "ns:active"=> 1 ),
      SOAP::Data->name( "ns:allowDuplicates"=> 1 ),
      SOAP::Data->name( "ns:description"=> 'New group' ),
      SOAP::Data->name( "ns:externallyOwned"=> 1 ),
      SOAP::Data->name( "ns:name" => $GROUP ),
      SOAP::Data->name( "ns:observedByAll" => '' ),
      SOAP::Data->name( "ns:observers" => '' ),
      SOAP::Data->name( "ns:site" => '' ),
      SOAP::Data->name( "ns:supervisors" ) ,
      SOAP::Data->name( "ns:timeZone" => '' ),
      SOAP::Data->name( "ns:useDefaultDevices" => 1 )
      );

      Unfortunately the actual XML emitted is:

      <?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:ns="http://www.alarmpoint.com/webservices/schema" 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>
      <ns:AddGroup>
      <ns:user xsi:type="xsd:string">ws_user1</ns:user>
      <ns:password xsi:type="xsd:string">LetMeIn</ns:password>
      <ns:clientTimestamp />
      <ns:clientIP />
      <ns:clientOSUser />
      <ns:company xsi:type="xsd:string">Default Company</ns:company>
      <ns:group />
      <ns:active xsi:type="xsd:int">1</ns:active>
      <ns:allowDuplicates xsi:type="xsd:int">1</ns:allowDuplicates>
      <ns:description xsi:type="xsd:string">New group</ns:description>
      <ns:externallyOwned xsi:type="xsd:int">1</ns:externallyOwned>
      <ns:name xsi:type="xsd:string">Test Group</ns:name>
      <ns:observedByAll xsi:type="xsd:string" />
      <ns:observers xsi:type="xsd:string" />
      <ns:site xsi:type="xsd:string" />
      <ns:supervisors /><ns:timeZone xsi:type="xsd:string" />
      <ns:useDefaultDevices xsi:type="xsd:int">1</ns:useDefaultDevices>
      </ns:AddGroup>
      </soap:Body>
      </soap:Envelope>

      What am I doing wrong this time? Why is the group node showing up this way?
    • Show all 3 messages in this topic