Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using spring-ws with already existing WSDL

Tags:

spring-ws

I am new to spring-ws. what ever tutorial i see starts with xsd and at the end generates a wsdl. What is the approach when we have already an existing wsdl.

Also i was having a doubt on contract first approach which is already discussed (though am not getting convinced with the answer)

spring-ws and contract-first approach

My assignment is to use spring-ws with an existing wsdl. can you please provide me an approach for this.

As per my understanding. In the process of contract first approach, I got the contract already so how to proceed further is not shown in any tutorial.

like image 743
zee Avatar asked Aug 31 '16 09:08

zee


People also ask

How do you call a SOAP Web service from REST API in spring boot?

Steps to Consume a SOAP service : Create spring boot project and Get the WSDL from the provider . Convert the WSDL to Stub. Understand the request ,response and the types ,operations using any tool like SOAP UI. Form the request object by mapping data and call the soap uri with marshal the java objects as XML.

What is MessageDispatcherServlet?

The MessageDispatcherServlet is a standard Servlet which conveniently extends from the standard Spring Web DispatcherServlet , and wraps a MessageDispatcher . As such, it combines the attributes of these into one: as a MessageDispatcher , it follows the same request handling flow as described in the previous section.


1 Answers

When developing a web service using Java you can use one of two approaches:

  • Contract-first: start with an WSDL that defines the web service operations and their input/output messages. Then generate the corresponding Java objects to implement the service.
  • Contract last: Start with the implementation of one or more methods in Java and generate the WSDL files based on these methods and the Java objects that they use.

Spring-WS, as you already mentioned, only supports the contract first approach. This means that you cannot develop a web service using Spring-WS without first having a WSDL or XSD that describes the input/output messages.

You should be able to create a service using Spring-WS using any valid WSDL file. For a concrete example let me point you to a blog post that I created that illustrates how you can develop a web service using Spring-WS starting from a WSDL file.

like image 87
CodeNotFound Avatar answered Oct 17 '22 02:10

CodeNotFound