cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Web Service target endpoint at runtime

Former Member
0 Kudos

Hi,

Is there a way to change the Web Service target end point (URL) at runtime for Web Dynpro application? My idea is when the location of the Web Service is changed, I do not have to import Web Service model from another URL and remapping the context, which is a tedious process.

I will reward you with valuable points.

- Teecheu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Loh,

I dont think with current WD framework its possible. Simply beacuse we dont access the WS methods directly, we have to access them through proxy classes which are generated during design time. I didnt find any way out to generate these proxies dynamically so the rest is also seems impossible. If there is any way out I would also like to know that.

I know it wont help...

regards,

Shubhadip

Former Member
0 Kudos

WSService = (ProxyWS) JNDIcontext.lookup("wsclients/proxies/.... Proxy JNDI Name");

WS = WSService.getLogicalPort();

String url =WS._getProperty(ProxyWS.ENDPOINT_ADDRESS_PROPERTY));

url = .....;

WS._setProperty(ProxyWS.ENDPOINT_ADDRESS_PROPERTY, url);

Former Member
0 Kudos

Hi Shubhadip,

I agree with you that WD framework does not provide such facility. But there is a workaround. We can manipulate the endpoint in the code such as the following,

wdThis.wdGetXXXComponentController().wdGetContext().

currentYYYElement().modelObject()._setEndPoint(endpoint);

This statement is called before ...modelObject().execute();

But, I do not find it efficient, because we have to explicitly set the endpoint at every single call to the Web Service. I was thinking it will be very much desired to have a way for developers to change the endpoint at anytime without the need of recompile and redeployment.

- Teecheu

Former Member
0 Kudos

Hi,

I am not able to find the _setEndPoint method in my Web Dynpro code. Could you please tell me how to get that?

I am using the code

wdThis.wdGetXXXComponentController().wdGetContext().

currentYYYElement().modelObject()._setEndPoint(endpoint);

up until .modelObject() I am able to see the methods but not the _setEndPoint method.

Thanks so much!

sridhar_k2
Active Contributor
0 Kudos

Andrew,

If your Model is successfully created, you can set end point tot your request object.

Lets assume under your context, request node exist.

Context

- RequestXXX

-parameters

-response

you can set endpoint to your request node like this from your controller it self.

wdContext.RequestXXXElement().modelObject()._setEndPoint("endpoint");

Regards,

Sridhar