You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Swetta Bhaskar <sb...@csidentity.com> on 2011/04/04 23:07:39 UTC

client making call axis server

Hello

 

If I create server through Axis2 , using eclipse->right click on my
project(Which has my java class)->WebService->run it for server->finish
Server created. Is it necessary that the client should also be made
through Axis2 or any client should be good which could make a call to
wsdl.

 

In other words after me creating a server through Axis web service . I
can just give the url to client the  <servername>/../.../....?wsdl and
using that they should be able to create a  client to make calls.

 

If I could get a simple java class which should be able to use my url of
wsdl and make calls to server.  I saw many client.java online they refer
to Qname, URI endpoint which confuses me . If I could get a a sample
explanation.

 

Thank you.

 

 


Re: client making call axis server

Posted by Android MD <an...@gmail.com>.
Hi,

I also have the same question. Basically, I want my stub's method signatures
to be same as the service that was used. Please note that I am not creating
a contract first web service, where you create the wsdl first. Instead, I am
going the POJO first approach. Where I have my neat little Java class, with
it's methods implementing business logic, and need to expose it using a web
service. For example, let's look a the following, my Web Service POJO class
looks like this,

public class StudentService
{

public Student registerNewStudent(Student student)
{

//code to persist student object to database using hibernate (or JPA) and
get the unique student id
return student;

}

}

Then I packaged this into an AAR and deployed to Axis2 war running inside
Tomcat 7.0

Using wsdl that is generated by Axis2, I generated client stub using the
Eclipse's code generator plugin. But the stub contains another level of
abstraction in the method signatures to wrap the parameters. For example,
the stub looked like this.

public class StudentServiceStub
{

public RegisterNewStudentResponse
registerNewStudent(RegisterNewStudentRequest rnreq) { ..... }

}

So when I want to use the service, the stub does not necessarily completely
mask the complexity of calling the web service. You have to know little
tidbits about Request/Response stuff, which is totally unnecessary.

Can someone please explain how we can get rid of these difficult to use
method signatures and instead generate a stub that is easy to call an Axis2
web service.

Thanks and best regards,

AndroidGuy...

On Tue, Apr 5, 2011 at 5:07 AM, Swetta Bhaskar <sb...@csidentity.com>wrote:

> Hello
>
> If I create server through Axis2 , using eclipse->right click on my
> project(Which has my java class)->WebService->run it for server->finish
> Server created. Is it necessary that the client should also be made through
> Axis2 or any client should be good which could make a call to wsdl.
>
> In other words after me creating a server through Axis web service . I can
> just give the url to client the <servername>/../…/….?wsdl and using that
> they should be able to create a client to make calls.
>
> If I could get a simple java class which should be able to use my url of
> wsdl and make calls to server. I saw many client.java online they refer to
> Qname, URI endpoint which confuses me . If I could get a a sample
> explanation.
>
> Thank you.
>
>