Hi,
First create property called for example myServiceAddress of type String in your ApplicationBean1. Also create set and get methods. Next add managed property to your managed-beans.xml. It should look like:
<managed-bean>
<managed-bean-name>ApplicationBean1</managed-bean-name>
<managed-bean-class>mypackage.ApplicationBean1</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>myServiceAddress</property-name>
<property-class>java.lang.String</property-class>
<value>service addres (ie. http://localhost:8080/MyService) </value>
</managed-property>
</managed-bean>
Next on your page add web service client by clicking "Add to page" on web service in servers tab. This will create property called for example MyServiceClient and type webservice.myservice.myservice.MyServiceClient.
Finally add this piece of code to your init() method:
getMyServiceClient().setAddress( getApplicationBean1().getMyServiceAddress() );
alternatively you can use
import javax.xml.rpc.Stub;
//...
public void init() {
//..
Stub stub = (Stub)getMyServiceClient();
stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, getApplicationBean1().getMyServiceAddress() );
}
best regards
Grzegorz