How to generate a wsdl without a default request / response suffix in Spring?
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 fr开发者_开发百科om 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!
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.
精彩评论