Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

java - WebServices : bare vs wrapped?

I generate some WebServices out of some existing wsdl

I use Maven to do this but some webservices are generated with

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)  

and the others with

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) 

Jaxb or xjc does this automatically ? because i do not have any differences in the wsdls...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

BARE webservices are generated when the 'operation' name, the 'message' name and the 'element' name are different in some shape or form. To auto generate your client or service stubs as WRAPPED, all of those three elements must be the same.

The workaround to that is to write your own stubs and use the @RequestWrapper/@ResponseWrapper annotations.

PS: All of the portType operations must have a 'wrapped' style request/response. Even the slightest deviation and it will default to BARE.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...