It's not a secret anymore!*
The moose likes Web Services and the fly likes The classes the wsimport generated create an extra wrapper element in the response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "The classes the wsimport generated create an extra wrapper element in the response" Watch "The classes the wsimport generated create an extra wrapper element in the response" New topic
Author

The classes the wsimport generated create an extra wrapper element in the response

Mika Tapanainen
Ranch Hand

Joined: Jun 11, 2009
Posts: 95
Hello,

I'm using the wsimport.bat in the Websphere 7 and when the generated java classes create the response there is an extra element I don't want.

In the response is the element XXXResponse



and I think it is from the wsdl operation element of the portType element:



I would like the response to be:



This is because our customers currently receive this kind of messages from the old webservice implementation.

Is it possible to get rid of the XXXResponse element?

BR,

Mika


SCJP, SCJD, SCEA
http://fi.linkedin.com/in/mikatapanainen
Mika Tapanainen
Ranch Hand

Joined: Jun 11, 2009
Posts: 95
I tried this:

http://stackoverflow.com/questions/7032381/java-soap-wsimport-force-wrapped-binding-from-document-literal-wrapped-wsdl

and the binding.xml contained the following value:



but this didn't work for me. Actually the generated source classes are identical without binding, with the value false and with the value true (except the wsimport generates the methods everytime different order).

If someone has experience in this field it would be nice to hear.
Mika Tapanainen
Ranch Hand

Joined: Jun 11, 2009
Posts: 95
It is maybe so that wsimport doesn't read the



element. If I change the element:



there is no error message. Only if the file is not correct XML there comes an error message.
Mika Tapanainen
Ranch Hand

Joined: Jun 11, 2009
Posts: 95
The binding.xml is not needed in this case.

The resolution was the add the annotation



in the class level of the service implementation class. There is same annotation in the interface, but it seems that the service implementation class doesn't inherit the annotations. Maybe it is said also in the JAX-WS specification:

3.4.1 Inheritance
WSDL 1.1 does not define a standard representation for the inheritance of wsdl:portType elements.


see more for example: http://download.oracle.com/otndocs/jcp/jaxws-2_2a-mrel4-eval-spec/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The classes the wsimport generated create an extra wrapper element in the response