views:

380

answers:

3

I use Java and Axis to develop my website and WebService and I hava a problem:

I have 1 WS module and I have pluged it into some websites run on diferent servers.

And I have a program call WebServices, but I want to invoke specific WebService (belong to specific my website), so I nedd to change value of <wsdlsoap:address location=""> at runtime.

For example, sometime I want to get data from website A I can invoke WS with

<wsdlsoap:address location="http://www.siteA.com/services/getDataServices"&gt;

and sometime I want to get data from website B I can use

<wsdlsoap:address location="http://www.siteB.com/services/getDataServices"&gt;

without change wsdl file

Please help me !!! Thanks.

A: 

there is an overridden method in the generated axis-code with accepts an url. That url is than used to make the call.

Salandur
A: 

Could you be more specific?

+1  A: 

I have solved my problem, thanks for your help.

Here is my code for anyone who want to do the same

//set Endpoint Address at runtime

//Calculator is class I used to make WS
//SimpleCalculatorWS is my project

CalculatorServiceLocator locator = new CalculatorServiceLocator();
locator.setCalculatorEndpointAddress(
    "http://10.0.0.90:8080/SimpleCalculatorWS/services/Calculator");