java - How to handle xml transmission data better
習慣沉默
習慣沉默 2017-05-17 10:00:35
0
2
592

The project needs to use xml to transmit data, for example:

<logisticsEventsRequest>
<logisticsEvent>
<eventHeader>
<eventType> LOGISTICS _TMS_CONFIRM_DUTYS </eventType>
<eventTime>2013-08-24 08:00 :00</eventTime>
<eventSource> STORECODE </eventSource>
<eventTarget>CP</eventTarget>
</eventHeader>
<eventBody>
< ;logisticsDetail>
<logisticsOrders>
<logisticsOrder>
<poNo>LP682343244</ poNo >
<occurTime>2013-03-08</occurTime>
< ;confirmPaymethod>A</confirmPaymethod >
<logisticsRemark>Please release after deduction</logisticsRemark>
</logisticsOrder>
</logisticsOrders>
</logisticsDetail>
</eventBody>
</logisticsEvent>
</logisticsEventsRequest>

The content of xml needs to be constructed. If you want to transmit json, create the object directly and then convert json. Now you want to transmit xml. Is there any convenient way?

習慣沉默
習慣沉默

reply all(2)
过去多啦不再A梦

There are also tools for converting objects to xml, such as com.thoughtworks.xstream

淡淡烟草味

Baidu JAXB.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template