views:

798

answers:

3

I'm trying to consume a Third Party web service, through a wsdl file provided. I would load the file locally from a Spring-J2EE based project underneath WEB-INF folder.

The wsdl might have more than one operation exposed. So I need a way to be able to choose the method to be called. I would also need to make use of a JaxbMarshaller.

Can anyone help with a code snippet for the same?

Thanks for the help.

+1  A: 

WebServiceTemplate, and Spring-WS generally, do not treat WSDL as the starting point. Rather, it's schema-oriented.

When you use WebServiceTemplate, you plug in the JaxmMarshaller, then invoke the marshalSendAndReceiver methods, passing in a SoapActionCallback which contains the SOAP Action you want to invoke. You can get the SOAP action URI from the WSDL. WebServiceTemplate will marshal your request, wrap it in a WSDL envelope with the SOAP action you specified, and fire it off.

If you want a framework that generates stubs from your WSDL, then Spring-WS is not for you.

skaffman
A: 

Hi!

I am doing the same thing , through a wsdl file provided at server side . and i have to access the file from server using a Spring-J2SE based project. and I am new in Spring Framework..

The wsdl might have more than one operation used and also return the value.

So, can I used the same method for this ??

Can anyone help with a code snippet for the same?

Thanks for the help in advanced.

Vigna Shah
A: 

Regarding

WebServiceTemplate, and Spring-WS generally, do not treat WSDL as the starting point.

What are the consequences of the above ? Does it lead to interoperability issues where the xml produced and sent won't be processed by the provider ?

Is it possible to consume a service using Spring Web Services and WebServiceTemplate if the provider was implemented using Axis 1.x ?

Edwin Dhondt