简体   繁体   中英

Axis2 implementing client side

I need to create connection to web service with axis2. I would like to know how can I convert recieved xmls to Java objects. Is there any good tutorials to learn how to do this?

Axis2 is pretty well documented. Make sure to check the axis2 user guide . On the other hand be aware of that using web services and axis2 is not a piece of cake sort of think, so read the docs exhausitvly. ;)

Either the XML is part of the SOAP request. In that case, Axis2 will convert it to Java for you.

If XML is part of a "data blob", then you need to do this yourself. There are several options:

  1. You can have a look at the generators which Axis2 uses. Try the docs .

  2. Use an XML OO mapper like Castor .

  3. You can write your own mapper (not really recommended).

  4. If you can influence the sender side, you can try to create XML that follows the rules for XMLEncoder . That would allow you to use the standard Java Serialization API to build objects.

use axis wsdl2java tool and put generated classes to your source files. Then first create a service stub with YourServiceStub(Service_Adress) and use that instance to invoke necessary methods.

for wsdl2java i commonly use:

wsdl2java -uri wsdlLocation -ss -sd -uw -g -o outputLocation

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