You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by MrNobody <to...@pepsi.com> on 2008/06/19 17:43:40 UTC

How do I tell WSDL2Java not to put URLs in the Stub?

I am trying to generate client side classes for a Web Service where the URL's
are configurable (without actually modifying the Stub class)

I worked with Web Services once before and the WSDL2Java tool generated
ServiceLocator class for the service and I could pass the end point URL
through that. It also generated several other classes included interfaces.
But now I am trying to do it with this new Web Service and all it generates
is a Stub class and a CallbackHandler class.

Why is it so different? 

My goal is to generate client classes where they are not dependent on the
end point URL being hard coded in the generated classes, but rely on the URL
being passed to them. But the only way I knew to do this was using a
ServiceLocator class but unfortunately for this web service it's just not
generating that class. Is there a special WSDL2Java command line option I am
not using? I dont set any options right now...
-- 
View this message in context: http://www.nabble.com/How-do-I-tell-WSDL2Java-not-to-put-URLs-in-the-Stub--tp18011876p18011876.html
Sent from the Axis - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: How do I tell WSDL2Java not to put URLs in the Stub?

Posted by keith chapman <ke...@gmail.com>.
Hi,

If you generate the client using Axis2 you can pass the URL to the
constructor of the stub. for e.g if FooStub was your stub, you could do the
following,

FooStub stub = new FooStub("http://localhost:8080/YOUR_URL");

If you use FooStub stub = new FooStub(); instead it would take the URL off
the WSDL.

Thanks,
Keith.

On Thu, Jun 19, 2008 at 9:13 PM, MrNobody <to...@pepsi.com> wrote:

>
> I am trying to generate client side classes for a Web Service where the
> URL's
> are configurable (without actually modifying the Stub class)
>
> I worked with Web Services once before and the WSDL2Java tool generated
> ServiceLocator class for the service and I could pass the end point URL
> through that. It also generated several other classes included interfaces.
> But now I am trying to do it with this new Web Service and all it generates
> is a Stub class and a CallbackHandler class.
>
> Why is it so different?
>
> My goal is to generate client classes where they are not dependent on the
> end point URL being hard coded in the generated classes, but rely on the
> URL
> being passed to them. But the only way I knew to do this was using a
> ServiceLocator class but unfortunately for this web service it's just not
> generating that class. Is there a special WSDL2Java command line option I
> am
> not using? I dont set any options right now...
> --
> View this message in context:
> http://www.nabble.com/How-do-I-tell-WSDL2Java-not-to-put-URLs-in-the-Stub--tp18011876p18011876.html
> Sent from the Axis - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org