Friday, 3 May 2013

MQ Adapter Adding xmlns="" to XML



Issues:
1)   Empty namespace tags in output XML
2)   Remove encoding=”UTF-8″ (or any)
Information From Oracle Docs:

Oracle® Fusion Middleware Release Notes Section 20.1.14, "Receiving an Empty Namespace Tag in an Output Message" 20.1.14 Receiving an Empty Namespace Tag in an Output Message The XML representation from an XSL file may differ from that used in a scenario in which a message is passed through with a transformation being performed or in which an assign activity is used, even though the XMLs are syntactically and semantically the same. For example, if you use a mediator service component to map an inbound payload that includes an element without a namespace to an outbound payload, you may receive an empty namespace tag in the output message. <Country xmlns="">US</Country> This is the correct behavior. A blank namespace, xmlns="", is automatically added.  
Solution: 

 1)      In outbound XSD introduce nxsd namespace and nxsd version as well as nxsd  encoding as shown 
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD" nxsd:encoding="UTF-8" elementFormDefault="unqualified" attributeFormDefault="unqualified">  <xsd:complexType name="SampleName"> 

2)      In outbound XSD introduce nxsd namespace and nxsd version as shown 
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD"             elementFormDefault="unqualified" attributeFormDefault="unqualified">  <xsd:complexType name="SampleName">

2 comments:

  1. Sujan,
    If possible, please give direct link to others blog page rather copy paste. Happy blogging.

    Rama

    ReplyDelete
  2. hey i never added my page in web. its just for me to track all the things..
    though i add almost all the links below every post(at least for my ref). :)

    ReplyDelete