You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-user@ws.apache.org by Wa...@toyota-europe.com on 2007/09/21 10:18:06 UTC

New to WSIF and "Unable to find an available port"

Hi,

I'm new to the WSIF framework and trying to get a sample up-and-running 
using one of our webservices.

This is the wsdl file



And I'm using the following code:

...
// create a service factory
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
System.out.println("WSDL file to use=>" + wsdlFile + "<");
WSIFService service = factory.getService(wsdlFile, null, null,
 "http://tempuri.org/TME.VehicleProduct.Service/2007/04/30",
                "VehicleProductSoap");
// get the port
WSIFPort port = service.getPort();
...

But when running this I always have the following exception:

org.apache.wsif.WSIFException: Unable to find an available port
        at org.apache.wsif.base.WSIFServiceImpl.getPort(Unknown Source)
        at org.apache.wsif.base.WSIFServiceImpl.getPort(Unknown Source)
        at com.tme.ea.ws.wsif.CarConfiguratorWebService.getService(
CarConfiguratorWebService.java:63)
        at com.tme.ea.ws.wsif.CarConfiguratorWebService.main(
CarConfiguratorWebService.java:43)

Can somebody advice me on this one?

Thanks
Walter




RE: New to WSIF and "Unable to find an available port"

Posted by gn...@wipro.com.
Hi,

I am not able to download the wsdl you attached. 

Anyway, how many ports are there for the given service?

If you have multiple ports, you can use another overloaded method getPort(portName) which takes the name of the port.

or, try to get the port for the given binding if you have multiple bindings for the service.

This you can do by

1) First , get all the ports from service by calling service.getPorts(). Will return you a Map.
2) Iterate through that and match the QName for the given binding and the port.
3) If matches , then that is the port you are looking for.

If you need more help. Pls send the WSDL again.

Regards
Gnanaprakash


-----Original Message-----
From: Walter.Heestermans@toyota-europe.com [mailto:Walter.Heestermans@toyota-europe.com]
Sent: Fri 9/21/2007 1:48 PM
To: wsif-user@ws.apache.org
Subject: New to WSIF and "Unable to find an available port"
 
Hi,

I'm new to the WSIF framework and trying to get a sample up-and-running 
using one of our webservices.

This is the wsdl file



And I'm using the following code:

...
// create a service factory
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
System.out.println("WSDL file to use=>" + wsdlFile + "<");
WSIFService service = factory.getService(wsdlFile, null, null,
 "http://tempuri.org/TME.VehicleProduct.Service/2007/04/30",
                "VehicleProductSoap");
// get the port
WSIFPort port = service.getPort();
...

But when running this I always have the following exception:

org.apache.wsif.WSIFException: Unable to find an available port
        at org.apache.wsif.base.WSIFServiceImpl.getPort(Unknown Source)
        at org.apache.wsif.base.WSIFServiceImpl.getPort(Unknown Source)
        at com.tme.ea.ws.wsif.CarConfiguratorWebService.getService(
CarConfiguratorWebService.java:63)
        at com.tme.ea.ws.wsif.CarConfiguratorWebService.main(
CarConfiguratorWebService.java:43)

Can somebody advice me on this one?

Thanks
Walter







The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com