• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create WS client automatically in Axis2

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am a newbie in Web Service. I am facing a problem in creating web service client.
Actually I have a .wsdl file refering to many .xsd.
When I am trying to create the client using bottom up approach I am getting confused to create the response because it is not visible which DTO puts the input parameters.

Please tell how to understand which DTO will set the parameters.

For example in AddMember.java shown below how do I know which method sets the I/P params (memberId , programCode,
tierLevel etc.).
Please suggest whether I can create the below class automatically in Axis2 , if not then where can I get the mapping of params with DTO.



 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally one would use the wsdl2java tool to create client code to access a given WS.
 
Kacee Saxena
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the command for you -

java -classpath "c:\dev\axis.jar"; org.apache.axis.wsdl.WSDL2Java
<wsdl-path> -N<Namespace> -oC:/<output dir> -v


Enjoy
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
java -classpath "c:\dev\axis.jar"; org.apache.axis.wsdl.WSDL2Java
<wsdl-path> -N<Namespace> -oC:/<output dir> -v

What you have suggested is related to Axis2 ?
If so then why am I using axis.jar?
If not then can I do the same thing using Axis2 ?
 
Kacee Saxena
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, it should be possible with Axis2. Please try and let us know in case there is a problem.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kousik Majumder wrote:If so then why am I using axis.jar?

Are you asking us why you are doing the things you're doing?

But seriously, run -don't walk- to upgrade to Axis 2. Axis 1 is way obsolete.
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I used the below command:-



It created all the DTO's and other classes separately that is in MembershipSoapServiceStub class.

But I did not find the client code in neither case.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!