This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes writing Java client for web service based on XSD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "writing Java client for web service based on XSD" Watch "writing Java client for web service based on XSD" New topic
Author

writing Java client for web service based on XSD

Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
Hello to all,

My question is : Is it possible to write Java client code for a web service without knowing about the WSDL file?

I have been given an XSD file and two XML files one is input and the other one is output xml. I don't have any WSDL associated with the webservice. How do I write the client code. Can JAXB be used here? I have written client code using Apache axis but every time i have an endpoint address in the form of WSDL but in this case i don't have WSDL...

What can I do? Please suggest me a solution.

Thanks and Regards,
Girish
Bhagat Singh Rawat
Ranch Hand

Joined: Apr 04, 2009
Posts: 93
Girish Vasmatkar wrote:Hello to all,

My question is : Is it possible to write Java client code for a web service without knowing about the WSDL file?

I have been given an XSD file and two XML files one is input and the other one is output xml. I don't have any WSDL associated with the webservice. How do I write the client code. Can JAXB be used here? I have written client code using Apache axis but every time i have an endpoint address in the form of WSDL but in this case i don't have WSDL...

What can I do? Please suggest me a solution.

Thanks and Regards,
Girish



I believe this would be a asynchronous call. is it right?


Brainbench Java 2.0 Fundamentals, J2EE 1.4
http://www.brainbench.com/transcript.jsp?pid=8192792
Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
Yes it is an asynchronous call. How do I now proceed with it. I have read webpage and I think this is exactly what I am looking for but this article doesn't provide any code reference.
Bhagat Singh Rawat
Ranch Hand

Joined: Apr 04, 2009
Posts: 93
This is just an example for Synchronous Call by using XSD, similarly you can use for asynchronous call too


Client Code for Purchase Order



Server Code for for Purchase Order ---- I am Using JAXMServlet............ You can use JAX-RPC



PO(Purchase Order) XSD looks like



Create Jar file from XSD, I was using XML Bean to create Jar filehttp://xmlbeans.apache.org/, and put jar in your classpath

Finally Run your client code

All the best and hope it will be helpful for you.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing Java client for web service based on XSD
 
Similar Threads
Need some explanations about web-services basics.
When the server generates WSDL during deployment of web service?
Design problem
How is it determined what web service artifacts are Published to data/wsdl?
wsdl and xsd.