tags:

views:

17

answers:

1

The definitions for the methods of a web service have been provided to me by a 3rd party, i've created the java classes and maven schemagen plugin generates the xsd brilliantly from the classes. I then set up a spring-ws-servlet etc to publish the wsdl, only the WSDL11Definition classes require a request and responsesuffix.... I don't have a suffix. the method names are things like getAttribute, setAttribute, refreshDetails, manageAttribute etc. Does anyone know of a way around this? are there other wsdl definition classes that can be referenced to do this, or perhaps other providers (instead of the suffixProviders that the defaultWsdl11Definition uses)?

Any help would be appreciated!

A: 

Spring-WS is designed around "schema first" design, rather than "code first":

When creating Web services, there are two development styles: Contract Last and Contract First. When using a contract-last approach, you start with the Java code, and let the Web service contract (WSDL, see sidebar) be generated from that. When using contract-first, you start with the WSDL contract, and use Java to implement said contract.

Spring-WS only supports the contract-first development style, and this section explains why.

You can make it work with "code first", but you're going to have a fight on your hands.

If you want to stick with Spring-WS, then I strongly suggest that you use the web service spec to write an XML Schema describing the operations, and then either generate java from that schema, or write the java by hand.

skaffman
Thanks - I was hoping to avoid having to write the WSDL by hand as I'm not too hot at it :-( I should really stick with Spring as I am meant to stick with the tools that we use on other projects - to avoid constantly chopping and changing all the time. We have followed this process before, but have always used the Request and Response suffixes.
Rainyday
@Rainyday: You don't have to write the WSDL by hand, just the schema. Spring-WS will generate the WSDL for you. One thing you could try is to generate a schema as you currently do, then modify it by hand to conform to Spring-WS's expectations. This would be a one-off task.
skaffman