开发者

Spring WS Client - How to create mapping POJO for WSDLs without using Axis

开发者 https://www.devze.com 2023-01-28 12:30 出处:网络
I\'m creating a Spring WS client. I have a huge WSDL from a third-party company. They provide a set of classes that maps to their WSDL via the Axis\' WSDL2Java.I don\'t want to use Axis or any depende

I'm creating a Spring WS client. I have a huge WSDL from a third-party company. They provide a set of classes that maps to their WSDL via the Axis' WSDL2Java. I don't want to use Axis or any dependencies from them.

Since this is a web service client, I'm free to choose any framework. My problem is how do I generate a mapping class for the WSDL without using Axis's WSDL2Java. Am I stuck with manipulating pure XML? Take note I'm using Spring WS.

Edit:

Is it true if the service provider has built their service with Axis 1, you're basically stuck with making a client that's also based on Axis 1? I read it from this answer JAX-WS client with Axis service. I thought web services are supposed to be decoupled or at least independent from the platform that it was created, allowing you to have a .Net开发者_C百科 based web service to be accessed from a Java based client and vice versa?


If you want to use Spring-WS, then your best bet is to use the wsimport tool that ships with Java 6 (or use the JAX-WS RI, if you're on Java5). This will generate JAX-WS stubs for the web service. Included in these stubs will be standard JAXB bindings for the WSDL's schema, and those can be used with Spring-WS (wsimport will generate other service stubs that you won't need for Spring-WS).


If you are only interested in generating the POJOs from the WSDL, I think you could just get the XSD from the WSDL and use XJC tool to generate only the JAXB beans. This would avoid generating useless JAX-WS stubs.

0

精彩评论

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