NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
joe
Joined: 20 Feb 2009 Posts: 2
|
Posted: Fri Feb 20, 2009 1:56 am Post subject: Where to specify the URL for web service client |
|
|
Really easy question...
In NetBeans 6.5 I created a web service client using the wizard. When it prompted for the WSDL, I pointed it to a local WSDL file on my file system because the WSDL is shipped with an SDK that I am using and is not available via http. That all worked fine.
In a source file I right clicked to add a web service call, and it generated the code just fine.
But I can't figure out how to specify the web service's URL to make the call. Ideally I can do this from the code and not from a configuration file, but any help would be appreciated.
It's got to be simple, but google and I couldn't find it.
Thanks in advance... |
|
| Back to top |
|
 |
Manuel Mall Posted via mailing list.
|
Posted: Fri Feb 20, 2009 6:07 am Post subject: Where to specify the URL for web service client |
|
|
See: https://jax-ws.dev.java.net/faq/index.html
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_AD
DRESS_PROPERTY, "...");
-----Original Message-----
From: joe [mailto:address-removed]
Sent: Friday, 20 February 2009 10:57 AM
To: address-removed
Subject: [nbj2ee] Where to specify the URL for web service client
Really easy question...
In NetBeans 6.5 I created a web service client using the wizard. When it
prompted for the WSDL, I pointed it to a local WSDL file on my file system
because the WSDL is shipped with an SDK that I am using and is not available
via http. That all worked fine.
In a source file I right clicked to add a web service call, and it generated
the code just fine.
But I can't figure out how to specify the web service's URL to make the
call. Ideally I can do this from the code and not from a configuration
file, but any help would be appreciated.
It's got to be simple, but google and I couldn't find it.
Thanks in advance... |
|
| Back to top |
|
 |
Jacek_Haraburda Posted via mailing list.
|
Posted: Fri Feb 20, 2009 9:19 am Post subject: Odp: Where to specify the URL for web service client |
|
|
You should modify a litle generated code. Simple example:
remove annotation:
//@WebServiceRef(wsdlLocation = "WEB-INF/wsdl/client/ClientService/ClienttService.wsdl")
private ClientService clientService = null;
//add method to initiate service:
private ClientService getClientService()
{
if (this.clientService == null)
{
this.clientService =
new ClientService("http://point.to.target.wsdl.location?WSDL", new QName("Client", "ClientService"));
}
return this.clientService;
}
And in generated "try catch":
my.package.ClientPortType port = getClientService().getClientBindingPort();
I have ws.property file with ws URLs placed in glassfish "config" directory (diferent on diferent enviroments (dev,test,production)),
new ClientService(this.getWsdlStorer().getServiceUrl("CLIENT_SERVICE"), new QName("Client", "ClientService"));
Regards
Jacek
"joe" <address-removed>
2009-02-20 02:56 Odpowiedz u |
|
| Back to top |
|
 |
joe
Joined: 20 Feb 2009 Posts: 2
|
Posted: Fri Feb 20, 2009 7:11 pm Post subject: It Works |
|
|
| Thank you both. It's working now. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|