Skip to Content

Create a JAVA client calling a proxy...


I succeed creating a servlet that calls a web service via a "deployable proxy".

Is it possible to create a java class (not a servlet or jsp) that connect to this proxy ?

Here is a sample of my client class:

InitialContext ic = new InitialContext();

Z_RFC_WS_TESTService sampleWS =

(Z_RFC_WS_TESTService) ic.lookup("java:comp/env/SampleWSProxy");

The WEB server is not do I insert the url and how do I get the name of the Context.INITIAL_CONTEXT_FACTORY ?

Thanks a lot.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jan 26, 2005 at 12:38 PM

    Hi David,

    > how do I insert the url

    props.put(Context.PROVIDER_URL, "yourhost:yourport");

    You'll also need to authenticate against the portal:

    props.put(Context.SECURITY_PRINCIPAL, "Administrator");
    props.put(Context.SECURITY_CREDENTIALS, "");

    > how do I get the name

    > of the Context.INITIAL_CONTEXT_FACTORY

    Depends on your WAS J2EE version. For 6.20, it is

    props.put(Context.INITIAL_CONTEXT_FACTORY, "");

    Then you create

    InitialContext ctx = new InitialContext(props);

    You'll need some lib's of the portal for communication, for 6.20 this is at least:

    <classpathentry kind="var" path="SAPJ2EE/services/naming/naming.jar"/>
    <classpathentry kind="var" path="SAPJ2EE/lib/inqmy-lib.jar"/>
    <classpathentry kind="var" path="SAPJ2EE/lib/inqmy-frame.jar"/>
    <classpathentry kind="var" path="SAPJ2EE/lib/inqmy-frame-lib.jar"/>
    <classpathentry kind="var" path="SAPJ2EE/lib/iq-lib.jar"/>
    <classpathentry kind="var" path="SAPJ2EE/services/p4/p4.jar"/>
    <classpathentry kind="var" path="SAPJ2EE/services/appclient/appclient.jar"/>

    Hope it helps


    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Detlev,

      Can you see in the Java forum my question about accessing EJB...

      I thing that if I resolve the problem of accessing an EJB, I could put my proxy in the EJB and call it from my standalone java class.

      But I have a problem accessing a simple EJB.

      Please tell me if everything is correct

      Thanks !

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.