Chris Kannon
Chris Kannon

Reputation: 6091

Mapping Requests to a Nonstandard Webservice

I'm writing a bridge between two old application on our network. One has a webservice that takes URL encoded parameters (GET) and returns an XML document. Like this:

http://mytest.com/getData/?format=xml&dateStart=2012-01-01

My question is this - I can use the XSD for the xml returned and marshall it into Java objects (xjc defined).. but is there any way to map the requests/responses to a jax-ws webservice (or similar?) It's not SOAP - so I can't go the WSDL, CXF/JAX-WS route, can I?

I was really hoping for an elegant solution to this without having to code it all from scratch (URL request , returned stream, then marshal). Is there a framework out there that would allow me configure a request? I thought WSDL supported verb="GET" but sadly, I can't seem to get it working with Apache CXF and WSDL2JAVA.

Am I totally off base here?

Upvotes: 0

Views: 105

Answers (2)

LINEMAN78
LINEMAN78

Reputation: 2562

Check out WSGen or you can add ?WSDL to the end of your JAX-WS endpoint to get the generated WSDL. This way all you have to do is create your JAX-WS annotated classes similar to your JAX-RS ones and the WSDL is generated and it should be able to handle your XJC generated objects with no problems.

http://metro.java.net/guide/ch02.html#create-a-metro-web-services-endpoint

Upvotes: 0

npe
npe

Reputation: 15699

I think JAX-RS may be of use here. Just create XSD schemas and convert them to Java classes, and use a REST client for that site.

You can probably do it with CXF too. See here.

Upvotes: 1

Related Questions