on 03-10-2008 11:21 AM
hi, i created a webservice deployeble client. when i use the proxys i got ClassCastException
here it is my code
Context ic = new InitialContext();
out.println("----1---");
Object lookuped =
ic.lookup(
"wsclients/proxies/sap.com/ClientProxyDefinition/in.mobileone.demo.proxy.WSClientProxy");
out.println("\n----2---"+lookuped.getClass());
PortableRemoteObject objPortableRemoteObject=new PortableRemoteObject();
out.println("\n---3--
");
Object narrowed =
objPortableRemoteObject.narrow(lookuped, AdminOperWS.class);
out.println("\n---4--" + narrowed);
AdminOperWS service = (AdminOperWS) narrowed;
out.println("----5---" + service);
AdminOperWSViDocument client = null;
ClsSuper objClsSuper = new ClsSuper();
String strErrorCode = null, strErrorMessage = null;
client =
(AdminOperWSViDocument) service.getLogicalPort(
"Config1Port_Document",
AdminOperWSViDocument.class);
out.println("----5---" + client);
objClsSuper = client.createUser("2", "lakshman", "lakshman", "ad");
i got the output:
-
1-----
-
2-----class in.mobileone.demo.proxy.AdminOperWSImpl
-
3----
java.lang.ClassCastException
plz send solu...
Thank U
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,Piyush
i create the standalone proxy also for the same webservice it is working fine.
but i am use the deployeble proxy for the same webservice in a servlet i face the problem.First i cannt use the narrow() method. i got the same exception ClassCastException. my friend says use the narrow() method that's way i am used that.
any way thanks for ur replay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshman,
In case of Deployable proxy projects, you shold be creating objects of the Service End Point Interfaces (SEI) generated in the Proxy Project, and not the way you are doing it.
You can refere the following link for this.
[Creating a Client Bean|http://help.sap.com/saphelp_nw04/helpdata/en/81/12703e5da3e946e10000000a114084/frameset.htm]
Regards,
Alka.
Hi Lakshman,
can you please elaborate how you are calling this web service( where you get the stub?)
Why are you using these lines?
PortableRemoteObject objPortableRemoteObject=new PortableRemoteObject();
out.println("\n---3--
Object narrowed =
objPortableRemoteObject.narrow(lookuped, AdminOperWS.class);
out.println("\n---4--" + narrowed);
These are used mailny for CORBA objects( while calling EJBs).
Just remove these line and try.
Please do come back with the output.
Regards,
Piyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.