开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜