Hi
I am a newbie in the list (and also in WSDP)
I have followed the step to create a Dynamic Proxy example following the
Hello example.
It runs fine.
Now, I would like to access a public Web Service and I am having a lot of
trouble.
(sorry if the question seems dumb but I really need help !!)
I have tried several examples :
//=== create service factory
ServiceFactory factory = ServiceFactory.newInstance();
//=== define qnames
String targetNamespace =
"
http://www.xmethods.net/sd/TemperatureService.wsdl";
QName serviceName = new QName(targetNamespace,
"TemperatureService");
QName portName = new QName(targetNamespace,
"TemperaturePort");
QName operationName = new QName("urn:xmethods-Temperature",
"getTemp");
URL wsdlLocation = new
URL("
http://www.xmethods.net/sd/TemperatureService.wsdl");
System.setProperty("proxyHost","secureproxy.prosodie");
System.setProperty("proxyPort","8080");
//=== create service
Service service = factory.createService(wsdlLocation, serviceName);
//=== create call
Call call = service.createCall(portName, operationName);
//=== invoke the remote web service
Float result = (Float) call.invoke(new Object[] {"19010"});
System.out.println("\n");
System.out.println("This example shows how to create a dynamic
client application that invokes a Web service.");
System.out.println("The webservice used was: " +
"
http://www.xmethods.net/sd/TemperatureService.wsdl");
System.out.println("The temperature for 19010 is: ");
System.out.println(result);
and I get an error with float
I tried :
//=== create service factory
ServiceFactory factory = ServiceFactory.newInstance();
//=== define qnames
String targetNamespace = "
http://www.themindelectric.com/"
+
"wsdl/net.xmethods.services.stockquote.StockQuote/";
QName serviceName = new QName(targetNamespace,
"net.xmethods.services.stockquote.StockQuoteService");
QName portName = new QName(targetNamespace,
"net.xmethods.services.stockquote.StockQuotePort");
QName operationName = new QName("urn:xmethods-delayed-quotes",
"getQuote");
URL wsdlLocation = new
URL("
http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
System.setProperty("proxyHost","secureproxy.prosodie");
System.setProperty("proxyPort","8080");
//=== create service
Service service = factory.createService(wsdlLocation, serviceName);
//=== create call
Call call = service.createCall(portName, operationName);
//=== invoke the remote web service
Float result = (Float) call.invoke(new Object[] {"BEAS"});
System.out.println("\n");
System.out.println("This example shows how to create a dynamic
client application that invokes a Web service.");
System.out.println("The webservice used was: " +
"
http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
System.out.println("The quote for BEAS is: ");
System.out.println(result);
and I get an error with invoke
What I am doing wrong ?
Could anyone send me :
- an example that works ?
- the way to compile ? (Do I follow the same procedure
ant build
ant deploy
ant build-dynamic
when I only develop the client part)
Thanks a lot
Dominique
> _________________________
> Dominique Sauquet
> dsauquet_at_prosodie.com
> Direction des Nouveaux Produits
> PROSODIE
> 150 Rue Galli?ni
> 92100 Boulogne Billancourt
>
> Tel : 01 46 84 13 12
> http://www.prosodie.com
> ____________________________
>