cancel
Showing results for 
Search instead for 
Did you mean: 

How to set server + port in adaptive web service model

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi All,

I have some trouble with the Webservice model.

First of all, it works perfectly, and I can use it.

Then I would like to change dynamically the server and the port before the execution.

So I did this:

...modelObject().setInvokerProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://server:port");

But it seems that nothing has changed, this property doesn't seem to be used during the execution.

I looked into the generated class ..._Model() when you create the model according to the webservice. Into this java class, the complete url of the webservice is stored like:

private static final String DESIGN_TIME_WSDL_URL = "http://<server>:<port>/........?wsdl&style=default&mode=standard";

Hopefully it is possible to change it dynamically !?

Thanks a lot for your help and support.

Best regards,

Emmanuel.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Emmanuel,

This can be done by specifying Destination for Web services.

Open you visual adminsitrator located at: C:\usr\sap\<system ID>\JC00\j2ee\admin\go.bat

open this go.bat file. It will open visual adminstrator.

Here, use Destinations under server->services.

In Destinations, you have option for web services. Create a destination for your web servcie here.

Now, you can specify htis destination in your webdynpro code efore calling web service.

write following code:

wdcontext.current<web service model node>element().modelObject()._setEndpoint(<destination name>);

after this execute your model.

It will work.

Let me know if you have any issues in it.

Regards,

Bhavik

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi Bhavik,

ok I have seen this configuration in some documents.

Do you mean it is impossible to do it in runtime without creating a destination into the j2ee visual admin ? if yes it's pity thing ..

This WebService will be deployed into some customer system, each time a configuration will have to be done ??!! I can beleive this ... I would prefer to do it in runtime only ...

Something else, with my version 7.1 no _setEndPoint(..) method exist.

Thanks for your support and Best regards,

Emmanuel.

Former Member
0 Kudos

Hi Emmanuel ,

Have you figured out a method to set Endpoint in 7.1 ?Are any alternate methods ?

Regards

Bharathwaj

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi Bharathwaj,

No set Endpoint available.

For the modelObject() we have only the possibility to:

...setInvokerProperty(...)

or

..._setField(QName, Object)

..._setAttribute(QName, Object)

?

Thanks for your help,

Best regards,

Emmanuel.

Answers (2)

Answers (2)

emmanuel_turci
Advisor
Advisor
0 Kudos

To get the final point.

Display properties of the webservice model in your IDE.

Give a name to defaultExecutionDestination and to defaultMetadataDestination, could be the same.

that's all for your WD.

Go into the portal to ... nwa/webservice

Then add a WS destination with the same name as above and the url choose http://<server>:<port>/inspection.wsil or the full WSDL if doesn't work.

helpfull link : https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq-Models-AdaptiveWebService&

Emmanuel.

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo,

see <a href="https://wiki.sdn.sap.com/wiki/x/IhU">SDN Wiki Page - WD Java - Models - Adaptive WS Models</a>.

Regards, Bertram

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi Bertram,

thanks, I know it already (I even rewarded your message) and I follow exactly this help document.

I have read yesterday a lot of messages into forum, but also documents regarding this adaptive webservice....

Anything more ?

Thanks for your support and best regards,

Emmanuel.