Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing Java client for web service based on XSD

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic