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

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

      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"
      <xs:import schemaLocation="WR_GENERAL.xsd" namespace="WRG"/>
      <xs:element name="MSG_WR_INIT">
      <xs:element ref="WRG:CMP_WR_GENERAL"/>
      <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"/>
      h2. Sub XSD truncated for brevity ...
      <?xml version="1.0" encoding="utf-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      <xs:import schemaLocation="CONTACT.xsd" namespace="WRCN"/>
      <xs:element name="CMP_WR_GENERAL">
      <xs:element minOccurs="0" ref="AC_CODE"/>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="WRCN:CMP_CONTACT"/>
      <xs:element name="AC_CODE" type="xs:string"/>

      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"?>
      USER_INFO="CCADMIN" xmlns="" >
      <WRG:CMP_WR_GENERAL xmlns="WRG" xmlns:WRG="WRG">
      <WRCN:CMP_CONTACT xmlns="WRCN" xmlns:WRCN="WRCN">

      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.
      <plt:partnerLinkType name="Produce_Message_plt" >
      <plt:role name="Produce_Message_role" >
      <plt:portType name="tns:Produce_Message_ptt" />
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
      <include schemaLocation="xsd/WR_INIT.xsd" />
      <wsdl:message name="Produce_Message_msg">
      <wsdl:part name="body" element="MSG_WR_INIT"/>
      <wsdl:portType name="Produce_Message_ptt">
      <wsdl:operation name="Produce_Message">
      <wsdl:input message="tns:Produce_Message_msg"/>

      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