• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Schema for Web service types ?  RSS feed

Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In attempting the Top Down approach, we create WSDL first and then Java code. So here we need to specify the schema we will be using
for operation and messages.

What I'm considering is how do we develop schema which will be used in WSDL? We can hand create a schema according to our need and
run wsdl2java which willl create Java Types for them.

Or we can even create Java first, use a tool to convert to schema, then use that into WSDL type. So this is a mixed kind of strategy for Web services.
(Top down and Bottom Up).

Although approach 1 seems to be good, the second one also is appealing, but I've not come across a tool doing so, which we can integrate in build process. What do think?
I'm still kinda inclined to first approach.

Ranch Hand
Posts: 2198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The mixed approach is indeed less complicated and enables at least me to more quickly get started with the XML schemas, which I then can adjust as required.
To create an XML schema from Java code, I use the following approach:
- Develop a code-first Java web service with annotations (continued in next step).
The method implementation(s) does not have to do anything, just enough as not to cause compilation errors.
- For parameters and return values that you want to obtain XML schema types for, create Java bean classes.
- Use the Java bean classes as parameter types and/or return types where appropriate in the web service implementation class.
- Use wsgen (included in JDK 6) or deploy the web service to, for instance, GlassFish.
This will cause the WSDL and associated XML schemas to be generated.
- Use the generated XML schemas in your WSDL-first development (after having done any adjustments).

Best wishes!
amol deshpande
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ivan,

I'll try and see if that works for me.

He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!