5 Replies Latest reply: Nov 20, 2013 4:02 AM by Mikematthews-Oracle RSS

    Trying (and failing) to read XML multi-dimensional data array

    Jon Coat

      i.e.

       

      <mpp:Vehicle>

        <mpp:Vehicle_Rgtrn_Ref>?</mpp:Vehicle_Rgtrn_Ref>

        <mpp:Vehicle_Model_Code>?</mpp:Vehicle_Model_Code>

        <mpp:DrivingRestrictionCode>?</mpp:DrivingRestrictionCode>

        <mpp:Object_Mnfct_Year>?</mpp:Object_Mnfct_Year>

        <mpp:Building_Number_const>1</mpp:Building_Number_const>

        <mpp:Building_Name>The Slums</mpp:Building_Name>

        <mpp:Sub_Building_Name>Flat 1</mpp:Sub_Building_Name>

        <mpp:Postcode_Area_Ref>???? ???</mpp:Postcode_Area_Ref>

        <mpp:Covers>

          <mpp:Cover>?</mpp:Cover>

          <mpp:Cover>?</mpp:Cover>

          <mpp:Cover>?</mpp:Cover>

        </mpp:Covers>

      </mpp:Vehicle>

      <mpp:Vehicle>........

       

      I'm currently trying to create a web service to read a SOAP message containing such XML. When reading the message, EDQ converts the singleton nodes in each Vehicle node group to a stringarray but only provides the last Cover node in each Vehicle in a stringarray. I'm not in control of the XML structure so trying to get the supplier to concatenate each vehicles covers into a delimited list within a single node may be a battle.

       

      Anybody else ever encountered this? Is it possible or am I flogging a dead horse trying to achieve this.

       

      Thanks in advance.

       

      Jon

        • 1. Re: Trying (and failing) to read XML multi-dimensional data array
          rde1

          Jon

           

          How are  you creating the web service?  If you using the 'wsdlizer' tool from a WSDL file, your best approach is to mark the request as 'multi-record'.  Then you will get an incoming message one record for each vehicle and the nested Cover items will become arrays.

           

          To do this, use the -multi switch on the tool.

           

          -multi in

           

          for multi-record inputs and

           

          -multi both

           

          for multi-record inputs and outputs.  This is the typical cleaning/standardization model where each vehical can be handled independently.

           

          Richard

          • 2. Re: Trying (and failing) to read XML multi-dimensional data array
            Jon Coat

            Hi Richard, I am using the wsdlizer so I'll give your suggestion a go.

             

            Cheers

             

            Jon

            • 3. Re: Trying (and failing) to read XML multi-dimensional data array
              JulesBD

              Hi Richard,

               

              Thank you for your suggestion to my colleague Jon regarding -multi in option. As he said, w

               

              hat we currently get when we have a SOAP message containing <Covers><Cover>A</Cover><Cover>B</Cover><Cover>C</Cover></Covers> is an EDQ stringarray containing the value {C}.

               

              I've tried your suggestion

               

              and ran the wsdlizer with the -multi in option but the wsdlizer fails with the following error:

               

              H:\Workspaces\svn\edqTrunk\EDQ\WebServices\WSDL>java -jar wsdlizer.jar -o lv-mpp-query-request-ws.jar -multi in MPP_Query_Request_Service.wsdl

               

              INFO: 10-Sep-2013 13:24:07: wsimport succeeded

              Problem encountered during annotation processing;

              see stacktrace below for more information.

              com.datanomic.director.webservices.apt.ScannerException: multi-record request element must contain single nested list

              com.datanomic.director.webservices.apt.Scanner$Processor$Servicer.makeDef(Scanner.java:747)

              etc.

              SEVERE: 10-Sep-2013 13:24:07: APT scan failed

               

              Unfortunately, the error message is not very helpful to me.  Do you know what it is whingeing about?  I've also tried running the wsdlizer on our old wsdl files, i.e. before we introduced the parent tag <Covers> around <Cover>, but this failed with the same result when running with the -multi in option

               

              The wsdl file, with most of the XML tags removed for clarity and brevity, looks like this:

               

              <wsdl:definitions xmlns:schema="http://xxxx/MppService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://xxxx/MppService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="LV" targetNamespace="http://xxxx/MppService">

                 <wsdl:types>

                    <xsd:schema xmlns="http://xxxx/MppService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://xxxx/MppService">

                       <xsd:element name="request">

                          <xsd:complexType>

                             <xsd:sequence>

                                <xsd:element minOccurs="1" name="CorrelationUID" type="xsd:string"/>

                                <xsd:element minOccurs="1" name="RequestorName" type="xsd:string"/>

                                <xsd:element minOccurs="1" name="Brands" type="brandType"/>

                                <xsd:element minOccurs="1" name="Parties" type="partiesType"/>

                                <xsd:element minOccurs="1" name="InsuredObjects" type="insuredObjectsType"/>

                             </xsd:sequence>

                          </xsd:complexType>

                       </xsd:element>

                       <xsd:element name="response">

                          <xsd:complexType>

                             <xsd:sequence>

                                <xsd:element name="CorrelationUID" type="xsd:string"/>

                                <xsd:element name="MPPResponseUID" type="xsd:string"/>

                                <xsd:element maxOccurs="unbounded" minOccurs="1" name="Brand" type="schema:brandsType"/>

                             </xsd:sequence>

                          </xsd:complexType>

                       </xsd:element>

                       <xsd:complexType name="brandsType">

                          <xsd:sequence>

                             <xsd:element name="BrandCode" type="xsd:string"/>

                             <xsd:element name="ResponseMPD">

                                <xsd:complexType>

                                   <xsd:sequence>

                                      <xsd:element minOccurs="0" name="FunctionAvailable" type="xsd:string"/>

                                      <xsd:element minOccurs="0" name="MessageCode" type="xsd:string"/>

                                   </xsd:sequence>

                                </xsd:complexType>

                             </xsd:element>

                             <xsd:element name="ResponseCI">

                                <xsd:complexType>

                                   <xsd:sequence>

                                      <xsd:element minOccurs="0" name="FunctionAvailable" type="xsd:string"/>

                                      <xsd:element minOccurs="0" name="MessageCode" type="xsd:string"/>

                                   </xsd:sequence>

                                </xsd:complexType>

                             </xsd:element>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="brandType">

                          <xsd:sequence>

                             <xsd:element maxOccurs="2" minOccurs="1" name="BrandCode" type="xsd:string"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="partiesType">

                          <xsd:sequence>

                             <xsd:element maxOccurs="unbounded" minOccurs="1" name="Party" type="schema:partyType"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="partyType">

                          <xsd:sequence>

                             <xsd:element minOccurs="0" name="PartyUID" type="xsd:string"/>

                             <xsd:element minOccurs="1" name="RoleCode" type="xsd:string"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="insuredObjectsType">

                          <xsd:sequence>

                             <xsd:element maxOccurs="1" minOccurs="0" name="Properties" type="schema:propertiesType"/>

                             <xsd:element maxOccurs="1" minOccurs="0" name="Vehicles" type="schema:vehiclesType"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="propertiesType">

                          <xsd:sequence>

                             <xsd:element maxOccurs="unbounded" minOccurs="0" name="Property" type="schema:propertyType"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="vehiclesType">

                          <xsd:sequence>

                             <xsd:element maxOccurs="unbounded" minOccurs="0" name="Vehicle" type="schema:vehicleType"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="propertyType">

                          <xsd:sequence>

                             <xsd:element minOccurs="0" name="BuildingNumber" type="xsd:string"/>

                             <xsd:element minOccurs="0" name="BuildingName" type="xsd:string"/>

                             <xsd:element maxOccurs="1" minOccurs="0" name="Covers" type="schema:coversType"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="coversType">

                          <xsd:sequence>

                             <xsd:element minOccurs="1" name="Cover" type="xsd:string"/>

                          </xsd:sequence>

                       </xsd:complexType>

                       <xsd:complexType name="vehicleType">

                          <xsd:sequence>

                             <xsd:element minOccurs="0" name="VehicleRegistrationMark" type="xsd:string"/>

                             <xsd:element minOccurs="1" name="ABIBrokernetCode" type="xsd:string"/>

                          </xsd:sequence>

                       </xsd:complexType>

                    </xsd:schema>

                 </wsdl:types>

                 <wsdl:message name="request">

                    <wsdl:part name="parameters" element="schema:request"/>

                 </wsdl:message>

                 <wsdl:message name="response">

                    <wsdl:part name="parameters" element="schema:response"/>

                 </wsdl:message>

                 <wsdl:portType name="LVEI">

                    <wsdl:documentation>Operations</wsdl:documentation>

                    <wsdl:operation name="process">

                       <wsdl:documentation>Process a query request</wsdl:documentation>

                       <wsdl:input message="schema:request"/>

                       <wsdl:output message="schema:response"/>

                    </wsdl:operation>

                 </wsdl:portType>

                 <wsdl:binding name="LVBinding" type="tns:LVEI">

                    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

                    <wsdl:operation name="process">

                       <soap:operation soapAction="http://xxxx/MppService"/>

                       <wsdl:input>

                          <soap:body use="encoded"/>

                       </wsdl:input>

                       <wsdl:output>

                          <soap:body use="literal"/>

                       </wsdl:output>

                    </wsdl:operation>

                 </wsdl:binding>

                 <wsdl:service name="LV-MPPQRS-v01">

                    <wsdl:port name="LVEndpoint" binding="tns:LVBinding">

                       <soap:address location="https://xxxx/LV-MPPQRS-v01"/>

                    </wsdl:port>

                 </wsdl:service>

              </wsdl:definitions>

               

              A colleague created the wsdl, it's been checked a number of times but no one can find anything dodgy that might account for the wsdlizer error we're getting.  So we're a bit lost now, the data coming in to our EDQ process is incomplete, which makes further development of out EDQ processes somewhat challenging.

               

              Any help would be greatly received.  Also happy to send any more information you may require.

               

              Jules

              • 4. Re: Trying (and failing) to read XML multi-dimensional data array
                1055511

                Hi,

                 

                Was this issue resolved? I have a similar issue wherein I have a complex business object XML with a schema that I need to use to design the EDQ web service to consume the XML Business object. Once EDQ web service consumes this XML, EDQ process needs to take over and clenase specific data from this XML and hand it back in the same format as a response. Oracle support mentioned the following upon raising a service ticket:

                 

                "If you have no control over the XML format provided by the calling system then you can use the EDQ wsdlizer.jar to build a custom web service. This is located in the dnDirector\tools directory and allows you to build a custom web service jar file using an XML schema. You copy the resulting file into the config\webservices directory and it appears as a new realtime source/destination. Depending on the complexity of the schema file you may need to run the wsdlizer with the ‘–nobuckets’ option which allows you to control how the XML is flattened using some custom JavaScript. This will almost certainly be necessary if the XML has many levels of nested elements."

                 

                Have not worked with wsdlizer.jar file earlier and would appreciate any detailed guidance based on the above lines.

                 

                Thanks in advance.

                 

                Regards,

                Vardhan

                • 5. Re: Trying (and failing) to read XML multi-dimensional data array
                  Mikematthews-Oracle

                  Yes, this was resolved offline.

                   

                  It is possible to customize EDQ using the wsdlizer to make it read in and write out hierarchical XML in real-time, but this is an advanced feature and you will require some assistance.

                   

                  EDQ does not natively read and write hierarchical data, so as part of this, you need to decide how to convert the hierarchical data into a record structure that EDQ can understand and process according to requirements. This can include array attributes on a record, but not arrays of arrays. So in some cases you may need to pluralize the data a little to flatten it. For example, when EDQ is connected to Siebel, an XML hierarchy representing a customer record with multiple addresses is flattened into multiple records with different addresses, but the same customer id (and name etc.), and processed through matching/cleansing... however, for multiple email addresses and phone numbers, these are all simply added to a single attribute as a delimited list (could be an array), and EDQ uses all the values. In this case the conversion is done outside of the product and native EDQ web services are used - a preferred approach in most cases as the full flexibility of EDQ web service definition through the UI can be used. Normally EDQ is only required to deal directly with hierarchical XML if there are restraints on converting this before it gets to EDQ.

                   

                  If you would like further assistance on the wsdlizer approach, please contact me separately at mike.matthews@oracle.com

                   

                  Regards,

                   

                  Mike