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 Leo Barcenas <le...@sd-net.co.jp> on 2003/11/01 07:43:23 UTC

Re: Service Name's soap:address location

Hello David,

Thanks for the information.

I forgot to tell write that I received an exception when I call the
getPort method of the service.
       WSIFPort p = service.getPort();

The exact exception is:

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)

Is there any way, that I could change the soap:address before I call the
getPort method?

I tried using another way, using the definition file for the service.
Below is a snippet of the code:

   Definition defWSDL = WSIFUtils.readWSDL(null, args[0]);

   WSIFService service = new WSIFService.class();
   service =
    factory.getService(
     defWSDL,
     defWSDL.getService(defWSDL.getQName()),
     defWSDL.getPortType(defWSDL.getQName()));

Same exception happens with this code. There is probably
another way perhaps to change the definition file. Right after
the readWSDL method. I tried to copy the WSDL file locally,
and change the soap:address to the remote server IP address.
But, same thing happens.
Is there anyway, that I can change the soap:address of Definition
file?

Hoping for your answer.

Many thanks.


Leo









----- Original Message ----- 
From: "David Seager" <SE...@uk.ibm.com>
To: <ws...@ws.apache.org>
Sent: Thursday, October 30, 2003 10:13 PM
Subject: Re: Service Name's soap:address location


>
> Hi Leo,
>
> That WSDL shouldn't execute correctly from a remote client, as localhost
> will resolve to the machine it's being run on. The best way is to store
the
> WSDL on a web server on the remote server machine, with the location set
> with the remote server's hostname. Then point the client at the WSDL on
the
> remote server.
>
> However, if you know which provider gets used, there are methods on some
to
> override the location URL. In the WSIFPort_ApacheAxis class, in the Apache
> Axis provider, there is a setEndPoint method which will do the trick. Here
> is my code which changes the URL to something else:
>
>       String wsdlLocation = "http://localhost:8080/axis/Expire.jws?wsdl";
>       WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
>       WSIFService service = factory.getService(wsdlLocation, null, null,
> null, null);
>       WSIFPort p = service.getPort();
>
>       // override port
>       WSIFPort_ApacheAxis pA = (WSIFPort_ApacheAxis)p;
>       pA.setEndPoint(new URL("http://localhost:8081/axis/Expire.jws"));
>
>       o = p.createOperation(operation);
>
>       m1 = o.createInputMessage();
>       m2 = o.createOutputMessage();
>       m3 = o.createFaultMessage();
>
>       boolean ok = o.executeRequestResponseOperation(m1, m2, m3);
>
> The WSDL referenced defines the Expire service to be at
> http://localhost:8080/axis/Expire.jws. However, the above code sends the
> request to the address in the override call. This only works if the
> provider being used is Apache Axis.
>
> Regards,
>
>
> David Seager
> IBM Hursley
> Internet seager@uk.ibm.com
>
>
>
>                       "Leo Barcenas"
>                       <leo@sd-net.co.jp        To:
<ws...@ws.apache.org>
>                       >                        cc:
>                                                Subject:  Service  Name's
soap:address location
>                       30/10/2003 11:33
>                       Please respond to

>                       wsif-user
>
>
>
>
>
>
>
> Hello!
>
> I would like to ask about the WSDL file used in WSIF. In particular,
> the soap:address location of the Service name.
> I'm just quiet puzzled that some of the files I saw is written the one
> below,
>
>   <service name="ServiceNM">
>     <port name="SoapPort" binding="tns:SoapBinding">
>       <soap:address location="http://localhost/WSDL/iLON100.WSDL" />
>     </port>
>   </service>
>
> Considering the above WSDL syntax, will this be able to correctly execute
> from a remote client? If not, is there a way that you can change
> "localhost"
> into the IP address of the server where the web service is located during
> runtime? I've tried it in VB.NET by using the WebReference's URL property
> and replacing "localhost" to the server's IP address.
>
> Hoping for your answer.
>
>
> Many thanks.
>
>
> Leo
>
>
>
>
>
>