cancel
Showing results for 
Search instead for 
Did you mean: 

changing port at run time

Former Member
0 Kudos

Hi,

I have created a deployable proxy project and in that new client proxy definition from a wsdl stored locally on my machine.

========================================

<wsdl:service name="ECC_CostCtrVarBudMonRuleIDQRService">

<wsdl:port name="ECC_CostCtrVarBudMonRuleIDQRSoapBinding" binding="tns:ECC_CostCtrVarBudMonRuleIDQRSoapBinding">

<soap:address location="http://us4456.wdf.sap.corp:50077/sap/bc/srt/xip/sap/ECC_CostCtrVarBudMonRuleIDQR?sap-client=005" />

</wsdl:port>

</wsdl:service>

===============================================

now my question is that during run time i want to change the location from where the service will be called.

I am not able to find how to change the ESA url at the run time.

any help is appreciated.

regards,

Saurabh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Anton,

i dont think I still clearly understood why I cannot do it. I did some research and feels that it can be done in the following manner. Do you see any problem in that. because I have still not tested. but I feel that this can solve my problem.

============================================================

InitialContext ctx = new InitialContext();

Object obj = ctx.lookup("wsclients/proxies/sap.com/xappsospesaservices~wsproxy/com.sap.xapps.osp.esaservices.wsproxy.bmalerts.cccpruleinfo.CCCPRuleInfoProxy");

ECC_CostCtrPosBudMonRuleIDQRService service = ( ECC_CostCtrPosBudMonRuleIDQRService )obj;

ECC_CostCtrPosBudMonRuleIDQR port = ( ECC_CostCtrPosBudMonRuleIDQR ) service.getLogicalPort();

//TODO confirm whether this works fine or not

//changing the ESA url at the run time from the service map.

port._setProperty("javax.xml.rpc.service.endpoint.address", "New URL" );

===================================================

This piece of information is available at the following URL

http://127.0.0.1:1294/help/index.jsp?topic=/com.sap.devmanual.doc.user/04/d2c60e78814516afe7811829f0...

regards,

saurabh

Former Member
0 Kudos

Hello Saurabh,

I am sorry, if you don't understand me and my conceptual concerns and if you have already found a solution yourself solving your problem then there is nothing else I can help you with.

kind regards,

anton

ps: The URL you gave us is a local loopback adress and therefore useles for anyone else but you

Former Member
0 Kudos

Hi Anton,

I think I dont exactly understood what you mean to say.

Do you mean that I have to change the logical port, then compile the proxy project and then work on it.

Or is there a way to do that at run time.

In my project I am getting the URL at the run time. and I have to use that URL to access the ESA service. How can I achive that.

Thanks,

Saurabh

Former Member
0 Kudos

Hello,

I mean to say that you cannot (officially) change the LP at runtime since there is no such functon to do that.

If it's only two URLs you have to choose from at runtime, configure two proxies and create a 'meta proxy object' and call the proxy suitable in the situation.

Choosing between services is a process decision, you shouldn't reconfigure the proxy at runtime.

regards,

anton

Former Member
0 Kudos

hi there,

afaik there's -unfortunately- no (official) way to do this.

No matter if you have a deployable proxy or a standalone proxy you would have to (at least) edit the logical port (LP) associated with the proxy and containig the service provider's URL. I think there's no official API to do this.

After all, despite the fact that we all have such a requirement in a certain project, it's questionable if it is a sustainable procedure to run-time manipulate entities with a repository character.

my 2 cents,

anton