简体   繁体   中英

Mule - JSON to XML - Unbound prefix

With my mule flow I get a JSON message and I use a JSON to XML transformer to send the XML to a Web Service.

HTTP => JSON to XML => WS Consumer

The XML needs a prefix " int: " :

<int:contact>Name</int:contact>

And the JSON format is like this:

{  
   "Modify":{  
      "int:contact":"Name"
   }
}

The JSON to XML transformer return an error:

javax.xml.stream.XMLStreamException: Unbound prefix: int

How can I pass the prefix?

you can use Namespace manager.

<mulexml:namespace-manager includeConfigNamespaces="true">
    <mulexml:namespace prefix="int" uri="http://int.com"/>
</mulexml:namespace-manager>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM