View Full Version : difference b/w ServletEndPoint and AbstractDomPayloadEndpoint? which one is pref ?why
kris_red
Oct 9th, 2006, 04:02 AM
What is the difference between creating the web services using org.springframework.remoting.jaxrpc.ServletEndPoin t and using spring-ws-1.0-m2.zip (org.springframework.ws.endpoint.AbstractDomPayloa dEndpoint.AbstractDomPayloadEndpoint).
Is it ok to use any way or am I missing some differences?
Can some one guide me through it, as I am trying to expose some functionality of my project which is implemented in SPRING, java etc…
Regards
Kris
Arjen Poutsma
Oct 9th, 2006, 05:43 AM
The approach is quite different. JAX-RPC (and therefore the ServletEndpoint) uses a remote procedure-call mechanism, basically RMI using XML. It tries to hide all the nastiness of converting objects to XML from the user: it is focussed on Java.
Spring-WS uses a message driven approach, where the focus is on the XML. You can use different ways to handle the XML, the AbstractDomPayloadEndpoint is just one way to do it. You could also use XML marshalling using the AbstractMarshallingPayloadEndpoint.
The difference becomes clear when you look at the samples. Compare the ServletEndpoint usage in the Petstore app with the Airline app in Spring-WS, and you will see that JAX-RPC exposes an existing service, which Spring-WS tries to create a separate little layer, similar to a MVC-layer, responsible for handling incoming XML request, and writing responses.
kris_red
Oct 9th, 2006, 05:50 AM
Hello Arjen
Thanks for the explanation. I just want to ask one more thing.
I am working on a pre-existing project based on SPRING and java. And now I just want to expose some functionality of it via web services.
Which one would be better ..ServletEndPoint or Spring-WS ?
I have done an example using ServletEndPoint and it was quite easy to expose some functionality.
Which one does u suggest?
Regards
Kris
Arjen Poutsma
Oct 9th, 2006, 06:18 AM
I would If you want to expose a Java service as web service, I would not use the ServletEndpoint, but use XFire (http://xfire.codehaus.org). It has excellent Spring integration.
However, the question is whether exposing a Java class as Web service is such a great idea. It might be easier for you, as a developer, but it's not necessarily easier as a consumer. Consumers don't care whether you use Java or not (if they would, then you could have used a faster binary RPC mechanism), they care about the XML messages they have to send.
And the best way to create these messages is to focus on the XML (i.e. WSDL and XSD), and let the Java follow from that, instead of the other way around. This approach is what Spring-WS is all about.
kris_red
Oct 9th, 2006, 06:29 AM
Thanks a lot for u r expert comments. Now i know what to choose.
I will go with spring-ws, as i also need to keep the consumers in mind.
Regards
Kris
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.