1 Reply Latest reply: Jun 21, 2013 1:57 AM by user100012345 RSS

    Formatting issue of XML being sent to queue of Vendor App.  Namespace Issue

    1010177
      We are currently upgrading one of our vendor applications and in the process we are changing all of are existing interfaces to use Oracle SOA.

      I have a simple SOA project with a webservice and a queue adapter. Between the 2 is a Mediator to transform the data. Both the webservice and Queue Adapter are using the same XSD.

      We can successfully put messages into the IBM Queue but the messages are not formatted in a way the Vendor application will accept it. The vendor application reads the XML based off of DTD's.

      My first hurdle was to get the DTD from the vendor converted to an XSD. I used Jdeveloper's Native format wizard to convert it but the resulting file had errors in it. Tried to put in one document with namespace aliases in the element name tags. I manually split up all the namespace into separate XSDs.

      h2. Main XSD. Root element of MSG_WR_INIT
      -----
      <?xml version="1.0" encoding="utf-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:WRG="WRG">
      <xs:import schemaLocation="WR_GENERAL.xsd" namespace="WRG"/>
      <xs:element name="MSG_WR_INIT">
      <xs:complexType>
      <xs:sequence>
      <xs:element ref="WRG:CMP_WR_GENERAL"/>
      </xs:sequence>
      <xs:attribute name="ID" use="optional" type="xs:string"/>
      <xs:attribute name="SRC_SYSTEM_CODE" use="optional" type="xs:string"/>
      <xs:attribute name="SRC_SYSTEM_INSTANCE" use="optional" type="xs:string"/>
      <xs:attribute name="USER_INFO" use="optional" type="xs:string"/>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      -----
      h2. Sub XSD truncated for brevity ...
      -----
      <?xml version="1.0" encoding="utf-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns="WRG"
      targetNamespace="WRG"
      xmlns:WRCN="WRCN"
      ...>
      <xs:import schemaLocation="CONTACT.xsd" namespace="WRCN"/>
      ...
      <xs:element name="CMP_WR_GENERAL">
      <xs:complexType>
      <xs:sequence>
      <xs:element minOccurs="0" ref="AC_CODE"/>
      ...
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="WRCN:CMP_CONTACT"/>
      ...
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      <xs:element name="AC_CODE" type="xs:string"/>
      ...
      </xs:schema>
      -----

      I can successfully put messages into the IBM MQ. The messages are in a format that the Vendor application cannot read though. What follows is the xml I put into the queue and the bold text is what needs to be removed for the vendor app to be able to read.

      h2. My resulting XML into the queue from SOA. Trimmed down.
      -----
      <?xml version="1.0" encoding="UTF-8"?>
      <MSG_WR_INIT ID="" SRC_SYSTEM_CODE="ARMWEB" SRC_SYSTEM_INSTANCE="ARMWEB"
      USER_INFO="CCADMIN" xmlns="" >
      <WRG:CMP_WR_GENERAL xmlns="WRG" xmlns:WRG="WRG">
      <WRG:AC_CODE/>
      ...
      <WRCN:CMP_CONTACT xmlns="WRCN" xmlns:WRCN="WRCN">
      <WRCN:CONTACT_ID/>
      <WRCN:CONTACT_NAME_1/>
      <WRCN:CONTACT_NAME_2/>
      <WRCN:CONTACT_TYPE/>
      <WRCN:EMAIL_ADDR/>
      <WRCN:FLEXIBLE_RPT_YN/>
      <WRCN:NPI_NO/>
      <WRCN:PRIMARY_YN/>
      <WRCN:RESP_GROUP_TYPE/>
      <WRCN:SOCIAL_SECURITY_NO/>
      <WRCN:STANDARD_YN/>
      <WRCN:TAX_ID/>
      ...
      </WRG:CMP_WR_GENERAL>
      </MSG_WR_INIT>
      -----

      I have looked in the Enterprise Manager and saw that the XSL file is outputing exactly what is needed by the vendor but the extra namespaces are getting added after that. Included below is the WSDL of the Queue Adapter.

      h2. Queue adapter WSDL.
      -----
      <wsdl:definitions
      name="ProduceArmWrInitMessage"
      targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/jms/Applicationtest/AddArmWorkRequest/ProduceArmWrInitMessage"
      xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/jms/Applicationtest/AddArmWorkRequest/ProduceArmWrInitMessage"
      xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
      <plt:partnerLinkType name="Produce_Message_plt" >
      <plt:role name="Produce_Message_role" >
      <plt:portType name="tns:Produce_Message_ptt" />
      </plt:role>
      </plt:partnerLinkType>
      <wsdl:types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
      <include schemaLocation="xsd/WR_INIT.xsd" />
      </schema>
      </wsdl:types>
      <wsdl:message name="Produce_Message_msg">
      <wsdl:part name="body" element="MSG_WR_INIT"/>
      </wsdl:message>
      <wsdl:portType name="Produce_Message_ptt">
      <wsdl:operation name="Produce_Message">
      <wsdl:input message="tns:Produce_Message_msg"/>
      </wsdl:operation>
      </wsdl:portType>
      </wsdl:definitions>
      -----

      I have searched this forum and others and have found some similar issues but their solutions didn't work.
      Things I have tried.
      - Putting xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD" in the XSD Schema tag. Found from here ( Re: writing XML without namespace? )
      This just removed all of the namespaces even the aliases on the tags which the vendor application needs.
      - I have tried sending the message over as an Opaque but I was unable to get it to work.
      - I have seen many articles saying to use elementFormDefault="qualified". The did not work still has the two namespaces in each parent tag.
      - I have manipulated the XSD's in so many ways I can't even list them all. I am new to XSD definitions.

      Any guidance would be appreciated.
      B. Wilson

      Edited by: B.W. on May 22, 2013 12:50 PM