File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes JBoss WSDL - custom schema types issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JBoss WSDL - custom schema types issues" Watch "JBoss WSDL - custom schema types issues" New topic
Author

JBoss WSDL - custom schema types issues

Dejan Mratinkovic
Ranch Hand

Joined: Nov 20, 2008
Posts: 65
Is there a way to configure how WSDL is genreated by JBOss?

JBoss + EJB3.
Web service with simple: @WebService()

WSDL auto generated on JBOSS startup.

Using it in JAVA clients works fine (@WebServiceRef).

But issue is with .NET - Visual Studion generates number of unnecessary classes wrapping simple types.

Cause: generated WSDL has schema defining new type for each element.
...
<xs:element name="submitApplication" type="tns:submitApplication"/>
...
<xs:complexType name="submitApplication">
<xs:sequence>
<xs:element minOccurs="0" name="applicationXMLAsString" type="xs:string"/>
</xs:sequence>
</xs:complexType>
...

Another WSDL generated by some Apache tools (another project) produces WSDL having:

<s:element name="createApplication">
<s:complexType>
<s:sequence>
<s:element name="applicationForDocument" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>

And .NET studio generates expected classes form latter one.

Regardless of is this a .NET issue and could it be solved on that side, can I produce WSDL that will produce format .NET expects?

I see that both approach describe the same thing, but can I force JBOSS somehow to avoid generating new types when they are not necessary?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Originally posted by Dejan Mratinkovic:can I produce WSDL that will produce format .NET expects?


By starting with the WSDL, developing your web service contract first - right now you are developing contract-last. There are some attributes in the web service annotations that let you control some aspects of the WSDL - but that control is nowhere near what you have once you go contract-first.

Also the service has no control over the client generated artifacts - so there are no "right" classes on the client side. The WSDL defines the SOAP requests and responses that are supported by the web service - it isn't some arcane "object definition language". How the client chooses to represent your service's interface based on that WSDL is entirely the client's business.

See also Bottom-up or Top-down and JAX-RPC to JAX-WS (Client impact).


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss WSDL - custom schema types issues
 
Similar Threads
Found unknown simple type: javax.xml.soap.SOAPElement
JAXB bindings
Consuming a .NET Typed DataSet from Java
Invalid type (xsi:type) is set when XML request is generated from web service client
How to bind JAXB persistant objects to WS parameters?