|
Replies:
7
-
Last Post:
Sep 26, 2008 5:24 AM
by: rabiddog5150
|
|
|
|
|
|
|
Shared XSD for WSDL
Posted:
Aug 14, 2008 4:46 AM
|
|
|
|
|
Hi
I am sitting with a situation where by I have a stack of web services. Now to make them more manageable I can divide them into smaller service sets. The only problem is that they share the same objects. Now here is where the problem comes in, the front end defines the shared objects in different namespaces which means there are duplicate objects. So is there any way to have the WSDL share the Entity definitions? Do I have to manually write the WSDL in order to achieve this and use the @WebService(wsdlLocation)?
Does anyone have any pointers on anything like this?
________________
Thanks and regards
Kenneth Clark
Solutions Engineer
ShadowLogo.png
Tel: 27 (0) 11 679 3075
Fax: 27 (0) 86 647 4819
Mobile: 27 (0) 84 583 1348
Email: <mailto:kenneth.clark@skyetech.co.za> kenneth.clark@skyetech.co.za
Website: http://www.skyetech.co.za
[att1.html] [image001.png]
|
|
|
|
|
|
|
Re: Shared XSD for WSDL
Posted:
Aug 14, 2008 9:49 AM
in response to: Kenneth Clark
|
|
|
I'm facing the very same problem and I would be glad to read from people who achieved something clever about this or people who knows the api/tools that can give developers a way to properly deploy a large set of webservices sharing xml types.
|
|
|
|
|
|
|
|
RE: Shared XSD for WSDL
Posted:
Aug 14, 2008 10:09 AM
in response to: eskatos
|
|
|
I am busy investigating the schemagen tool. It seems it has the ability to do what we are looking to do. For further info have a look at https://jaxb.dev.java.net/nonav/2.0.2/docs/schemagen.html
If I come across a nice simple solution I will reply to this form but this looks to e the most promising. I have a feeling we are going to have to use it in conjunction with wsgen for the WSDL generation and edit the generated wsdl's to import the master schema.
________________ Thanks and regards
Kenneth Clark Solutions Engineer
Tel: 27 (0) 11 679 3075 Fax: 27 (0) 86 647 4819 Mobile: 27 (0) 84 583 1348 Email: kenneth.clark@skyetech.co.za Website: http://www.skyetech.co.za
-----Original Message----- From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org] Sent: 14 August 2008 18:49 To: users@glassfish.dev.java.net Subject: Re: Shared XSD for WSDL
I'm facing the very same problem and I would be glad to read from people who achieved something clever about this or people who knows the api/tools that can give developers a way to properly deploy a large set of webservices sharing xml types. [Message sent by forum member 'eskatos' (eskatos)]
http://forums.java.net/jive/thread.jspa?messageID=293369
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.3/1611 - Release Date: 8/14/2008 6:20 AM
No virus found in this outgoing message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.3/1611 - Release Date: 8/14/2008 6:20 AM
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
|
|
RE: RE: Shared XSD for WSDL
Posted:
Aug 14, 2008 2:04 PM
in response to: podenski
|
|
|
Thanks for the pointer
Ok so I kinda got this running, now when I run the schemagen tool I am getting a really annoying message that fails the entire process. I have a set of managers that throw exceptions if preconditions aren't met. The managers are exposed via webservices. I have tried compiling the entities only but it traverses the directories underneath the entities.
error: java.lang.StackTraceElement does not have a no-arg default constructor.
I don't need the Exceptions serialized and can't seem to find a way to tell the schemagen task to ignore the files.
Does anyone have a "good" example ant file for schemagen task? I cannot find anything!!!
________________ Thanks and regards
Kenneth Clark Solutions Engineer
Tel: 27 (0) 11 679 3075 Fax: 27 (0) 86 647 4819 Mobile: 27 (0) 84 583 1348 Email: kenneth.clark@skyetech.co.za Website: http://www.skyetech.co.za
-----Original Message----- From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org] Sent: 14 August 2008 20:36 To: users@glassfish.dev.java.net Subject: Re: RE: Shared XSD for WSDL
For more insight into how you can use the schemagen and xjc tools to help with this problem read the following blog entry by Kohsuke:
<http:// [Message sent by forum member 'podenski' (podenski)]
http://forums.java.net/jive/thread.jspa?messageID=293394
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.3/1611 - Release Date: 8/14/2008 6:20 AM
No virus found in this outgoing message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.3/1611 - Release Date: 8/14/2008 6:20 AM
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: Shared XSD for WSDL
Posted:
Aug 15, 2008 4:48 AM
in response to: Kenneth Clark
|
|
|
Hi,
Following your question, I will present a use case.
Imagine we have two "from java" webservices named FromJavaWS1 and FromJavaWS2. Theses two webservices use MyPojo and MyException in their messages.
When deployed theses webservices triggers the generation of WSDLs and XSDs with wsgen. How do we specify that they must use common XSDs ?
On the client part we can use wsimport to generate FromWSDLWSClient1 and FromWSDLWSClient2. Is there some howto about using depends/produce wsimport directives in a such common case ?
Paul
Le Thursday 14 August 2008 13:46:38 Kenneth Clark, vous avez écrit : > Hi > > I am sitting with a situation where by I have a stack of web services. Now > to make them more manageable I can divide them into smaller service sets. > The only problem is that they share the same objects. Now here is where the > problem comes in, the front end defines the shared objects in different > namespaces which means there are duplicate objects. So is there any way to > have the WSDL share the Entity definitions? Do I have to manually write the > WSDL in order to achieve this and use the @WebService(wsdlLocation)? > > Does anyone have any pointers on anything like this? >
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
RE: Shared XSD for WSDL
Posted:
Aug 15, 2008 7:23 AM
in response to: Paul
|
|
|
I think what you are looking for is the schemagen and then wsimport/wsgen (can't remember) then set the wsdllocation to the remote server hosting the definitions (wsdl and xsd)
I am just have an issue with no arg constructors when running the schemagen ant task, bit of a show stopper as everyone says write a marshaller but how do you do that for an exception.StackTraceElement 
Will keep you posted
https://jaxb.dev.java.net/nonav/2.0.2/docs/schemagen.html might help. I am pretty sure there must be a way to incorporate this into an ant task, just having a tough time doing it ________________ Thanks and regards
Kenneth Clark Solutions Engineer
Tel: 27 (0) 11 679 3075 Fax: 27 (0) 86 647 4819 Mobile: 27 (0) 84 583 1348 Email: kenneth.clark@skyetech.co.za Website: http://www.skyetech.co.za
-----Original Message----- From: Paul [mailto:paul@nosphere.org] Sent: 15 August 2008 13:49 To: users@glassfish.dev.java.net Subject: Re: Shared XSD for WSDL
Hi,
Following your question, I will present a use case.
Imagine we have two "from java" webservices named FromJavaWS1 and FromJavaWS2. Theses two webservices use MyPojo and MyException in their messages.
When deployed theses webservices triggers the generation of WSDLs and XSDs with wsgen. How do we specify that they must use common XSDs ?
On the client part we can use wsimport to generate FromWSDLWSClient1 and FromWSDLWSClient2. Is there some howto about using depends/produce wsimport directives in a such common case ?
Paul
Le Thursday 14 August 2008 13:46:38 Kenneth Clark, vous avez écrit : > Hi > > I am sitting with a situation where by I have a stack of web services. Now > to make them more manageable I can divide them into smaller service sets. > The only problem is that they share the same objects. Now here is where the > problem comes in, the front end defines the shared objects in different > namespaces which means there are duplicate objects. So is there any way to > have the WSDL share the Entity definitions? Do I have to manually write the > WSDL in order to achieve this and use the @WebService(wsdlLocation)? > > Does anyone have any pointers on anything like this? >
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.3/1613 - Release Date: 8/15/2008 5:58 AM
No virus found in this outgoing message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.3/1613 - Release Date: 8/15/2008 5:58 AM
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: RE: Shared XSD for WSDL
Posted:
Sep 26, 2008 5:24 AM
in response to: Kenneth Clark
|
|
|
Ok I have figured it out but it is a two fold fix. If anyone knows a cleaner way please let me know.
1) On the endpointinterface define the targetNamespace @WebService(targetNamespace = "http://services.myshop.com")
Add this to every endPointInterface that you objects shared. This means that the WSDL namespace will be shared across all wsdls
2) For visual studio clients you need to use the wsdl tool (configure it as an external tool) and use the following arguments file structure <wsdlParameters xmlns="http://microsoft.com/webReference/"> <nologo>true</nologo> <parsableerrors>true</parsableerrors> <sharetypes>true</sharetypes> <namespace>MyServices.ServiceDefinition</namespace> <out>ServiceReference/MyServices.cs</out> <documents> <document>http://server:port/wsdlreference1?wsdl</document> <document>http://server:port/wsdlreference2?wsdl</document> </documents> </wsdlParameters>
This will force the generator to generate the client stubs and share the objects. My head hurts HTH
|
|
|
|
|