cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Deployable Proxy in a Web Dynpro Application

Former Member
0 Kudos

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!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

I am trying to use deployable proxy in JSPDynpage and experiencing same problem.

Can you please let me know how to add the reference and where to add.

Thanx

Dheeram

Former Member
0 Kudos

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>

Former Member
0 Kudos

Hello Jason,

I have the same problem with my deployable Proxy....

How did you solve it?? According to your post i took a look into the application-j2ee-engine.xml. there was the proxy already put in...

Do you have an idea, how to solve this classcastexception-problem??

Best Regards Philipp