2 Replies Latest reply on Apr 24, 2012 12:37 PM by user12947803

    Issue with working on a webservice that has  xml elements with attributes

      This is  a branchout of Thread: Some more complex sample of invokin WS needed_

      We are working on a project that involves a outbound SALT Web service call that includes complex elements with attributes..We are looking for options of how to use FML API's to pass these attribute values from the application code.

      We opened a ticket with oracle where we were suggested to frame the entire xml and pass the xml using the FML32 of the complex element. But when we framed the xml for Service and put the entire XML which includes the attributes using the FML ID of Service.

      Please find a sample Schema and XML similar to the one we are working on...its associated code

      <?xml version="1.0" encoding="UTF-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
           <xs:element name="Service" type="Service_Type" nillable="true">
                     <xs:documentation>Comment describing your root element</xs:documentation>
           <xs:complexType name="Service_Type">
                     <xs:element name="DateTime" type="xs:dateTime" nillable="true">
                     <xs:element name="UUID" nillable="true">
                     <xs:element name="Status" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded">
                <xs:attribute name="Version" type="xs:string" use="required">
                <xs:attribute name="Name" type="xs:string" use="required">

      The sample XML is :

      ___<?xml version="1.0" encoding="UTF-8"?>___
      ___<!--Sample XML file generated by XMLSpy v2010 rel. 2 (http://www.altova.com)-->___
      ___<Service Name="TestService" Version="1.1" xsi:noNamespaceSchemaLocation="Untitled6.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">___
      ___     <DateTime>2001-12-17T09:30:47Z</DateTime>___
      ___     <UUID>text</UUID>___

      wsdlcvt generated the mif file with Service as a FML32 type and all its child elements as "mbstring". We tried to leave as it is and we also tried to replace all the child elements and just had a mif entry for "Service" as a mbstring neither produced a different output...Tried to dump using Ferror32 which did not dump any..._

      The sample C/C++ code as per suggestions were to do the following...

      _1) Have a string with the entire XML for Service_
      xmldata="<Service Name=\"TestService"\ Version="1.1\"_ xsi:noNamespaceSchemaLocation=\"Untitled6.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">_
      _     <DateTime>2001-12-17T09:30:47Z</DateTime>_
      _     <UUID>text</UUID>_

      _2) Use Fmbpack32 to create a mbstring data_
      _memcpy(reqmbptr, (char*)xmldata.data(),xmldata.length());_
      _Fmbpack32(mbcodeName,reqmbptr,len, packdata,(FLDLEN32 *)&packedlen,0);_
      userlog("Size of packedlen is %d",packedlen);

      3) Add the packed data to the output buffer
      Fadd32(fmlbuffer,Service, packdata,packedlen );

      But we do not see the Service tag populated in the GWWS outbound request.Everything else makes it....any help on how to move ahead would be appreciated...