java - How to use Mule's XML-to-Object transformer? -
What steps have been taken? What should be in the driver class? How should I map XML to create a POO? How do I configure transformer?
You can use a driver class such as XPPNDR
such as
The flow will look like this
& Lt; Mulexml: xml-to-object-transformer doc: name = "XML object" driverClass = "com.thoughtworks.xstream.io.xml.Xpp3Driver" & gt; & Lt; Mulexml: alias name = "abc" square = "a.b.c.abc" /> & Lt; / Mulexml: XML-to-Object Transformer & gt; & Lt; Component class = "test1" doctor: name = "java" /> & Lt; / Flow & gt;
http request
http: // localhost: 8082 / XmlToObj
header content type type / xml Post data
& lt; ABC & gt; & Lt; Def & gt; Ggggg & lt; / DF & gt; & Lt; Ghi; Gt; Hhhhh & lt; / Ghhi & gt; & Lt; / Abc & gt;
ABC class
package a.b.c.Abc; Import javax.xml.bind.annotation.XmlRootElement; @ XmlRootElement (name = "ABC") public class ABC {Private string def; Private string d; Public ABC () {} public string getDef () {return def; } Public zero set def (string def) {this.def = def; } Get public string () {returns d; } Public zero set cahi (string d) {this.ghi = ghi; }}
class 1 exam (component)
public class test 1 {public object receipt (ABC ABC) exception {System.out.println ( Abc); Return "Success"; }}
Comments
Post a Comment