cancel
Showing results for 
Search instead for 
Did you mean: 

Change Destination at runtime in Adaptive Web Service Model

abrahamvadillo
Explorer
0 Kudos

Hi,

I need to change at the runtime the METADATA_DESTINATION and EXECUTION_DESTINATION in an Adaptive Web Service Model. is this possible?.

Something similar at Multiple Back End Support for the Adaptive RFC Model

http://help.sap.com/saphelp_nw70/helpdata/en/af/84a34098022a54e10000000a1550b0/frameset.htm

but in an Adaptive Web Service Model.

We have EP 701 SP6.

Regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have an idea how we could work around the issue, even though I have not tried it yet.

You could try the following:

- locate the auto-generated .java file for your WS model, e.g.

DCs\example.com\com.sapconsulting\demo_app\_comp\gen_wdp\packages\com\sapconsulting\demo_app\demowebservice\model\DemoWSModel.java

- copy the .java file to a place that you can control, e.g. the /src directory

- modify the .java file so that its constructor does not read the destination data from the auto-generated source, but rather from an additional constructor:

old:

private static final String METADATA_DESTINATION = "designtime_dest_meta"; 
  private static final String DEFAULT_EXECUTION_DESTINATION = "designtime_dest_exec";

new:

public DemoWSModel(String destMeta, String destExec) {
    super(DESIGN_TIME_WSDL_URL, 
          destMeta, interfaceQName, 
          NAMESPACE_MAPPING_AS_STRING, MC_NAME_MAPPING, 
          destExec, TYPED_MODEL_INFO);
  }

Then, during runtime, you might be able to instantiate your model manually and to issue some requests to arbitrary destinations:

DemoWSModel model = new DemoWSModel("runtime_dest_meta", "runtime_dest_exec");
// create + fill request objects here
// ...
request.execute();

I guess you will not be able to use the context with this solution, but maybe this drawback is acceptable.

Good luck

Thomas

former_member185086
Active Contributor
0 Kudos

Hi

Follow the given help

1 [Changing destination at runtime with adaptive web servies |/thread/211455 [original link is broken];

2.[Adaptive Web Service |http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService]

BR

Satish Kumar