on 04-18-2006 2:24 PM
Hi,
We have a Web Dynrpo application whose model is built from a set of Java business objects (POJOs.) These Java business objects currently make calls to a back-end R/3 system using JCo. We would like to provide the ability to allow the calls to be made over Web Services to the back-end system.
To call the RFMs as web services we have created a Deployable Proxy project, added the proxy as a public part, then referenced that public part in the web dynpro application. At this point we can write code to call the web service that looks something like:
InitialContext ctx = new InitialContext();
Object serviceObject = ctx.lookup("wsclients/proxies/meridium.com/rcmo~proxies/com.meridium.rcmo.ws.proxies.plants.PlantProxy");
Z_MRDM_GET_PLANTSService service = (Z_MRDM_GET_PLANTSService)ctx.lookup("wsclients/proxies/meridium.com/rcmo~proxies/com.meridium.rcmo.ws.proxies.plants.PlantProxy");
Z_MRDM_GET_PLANTSPortType port = service.getLogicalPort();
Z_MRDM_GET_PLANTS plantParameter = new Z_MRDM_GET_PLANTS();
plantParameter.setI_PLANTID(id);
plantParameter.setI_PLANTNAME(name);
Z_MRDM_GET_PLANTSResponse response = port.z_MRDM_GET_PLANTS(plantParameter);
MT001W[] plantArray = response.getET_PLANTS();
The problem is that when I call looup to retrieve the service implementation I get a ClassCastException.
The tutorials for using a proxy in web dynpro all assume that the web service is what the model is based upon but that's not possbile for our scenario we need to call the proxy from the business objects which are the basis for our model.
According to the help documentation for consuming a deployable proxy in a JSP page:
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/b9766df88f4a24967dae38cb672fe1/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/b9766df88f4a24967dae38cb672fe1/frameset.htm</a>
It discusses adding JNDI mappings. Is this what's needed for the reference to work in a Web Dypro application too? If so, how would one add the JNDI mappings references to a Web Dynpro application?
Many thanks!
I found that in order to use deployable proxies in a web dynpro project it is necessary to add a sharing reference to the web dynpro project that identifies the proxy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dheeram,
I'm not certain about JSPDynpage specifically, but in a general J2EE Enterprise Application project you can add a reference to the application-j2ee-engine.xml file. For example here's the content of an application-j2ee-engine.xml file that references a proxy:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
<reference
reference-type="hard">
<reference-target
provider-name="sap.com"
target-type="library">com.sap.mw.jco</reference-target>
</reference>
<reference
reference-type="hard">
<reference-target
provider-name="sap.com"
target-type="library">com.sap.aii.proxy.framework</reference-target>
</reference>
<reference
reference-type="hard">
<reference-target
provider-name="sap.com"
target-type="library">com.sap.aii.util.misc</reference-target>
</reference>
<reference
reference-type="hard">
<reference-target
provider-name="sap.com"
target-type="interface">tc/sec/destinations/interface</reference-target>
</reference>
<reference
reference-type="hard">
<reference-target
provider-name="sap.com"
target-type="library">security.class</reference-target>
</reference>
<reference
reference-type="weak">
<reference-target
provider-name="sap.com"
target-type="service">tc~sec~destinations~service</reference-target>
</reference>
<reference
reference-type="weak">
<reference-target
provider-name="sap.com"
target-type="interface">tc~sec~destinations~interface</reference-target>
</reference>
<reference
reference-type="weak">
<reference-target
provider-name="engine.sap.com"
target-type="service">webdynpro</reference-target>
</reference>
<reference
reference-type="weak">
<reference-target
provider-name="meridium.com"
target-type="application">rcmo~proxies</reference-target>
</reference>
<provider-name>sap.com</provider-name>
<fail-over-enable
mode="disable"/>
</application-j2ee-engine>
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.