on ‎2007 Apr 02 3:48 PM
Hello Experts,
i have a problem with casting a javax.rmi.Remote -Object into an object that extends com.sap.engine.services.webservices.jaxrpc.encoding.GeneratedComplexType. I searched already in the Sun API or in SAP Java API. But i didn't find a hint how to cast the Remote object in my own one.
I'm want to consume a WebService in my app. According to the Tutorial on this link: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0cac0dea-0d01-0010-edb4-8c7b068f...
But the Service does not answer with the right object. I only receive this javax.rmi.Remote Interface Object.
What do i have to do to cast this Remote Object into the described object?
I would be very happy to get an answer on that!!!
Thanks for the help!!!
Best Regards Philipp
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hello Denis,
i just received a ClassCastException, nothing else ...
There is nothing in the StackTrace.
MyWebService myws = WebserviceConnection.initiate();
Remote remObj = myws.getLogicalPort(logicalPorts<i>,logReq.getClass());
logReq = (LoginRequest) remObj;--> Here i get the Exception
The whole method is surrounded by an try-catch-block!
I think it's more a programming skill thing than a technical problem.
Best Regards
Philipp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Denis,
1. i didn't touch the proxy.
2. There is no method: webservice.getlogicalPort() ; there is only on that has the input parameter Class to specify the called object. But i don't get the right object, i just get a java.rmi.Remote-Object. And if i try to cast it into the right one according to the Tutorial, i receive a classcastexception.
I tried to call on of these methodes with and without logicalportname but without success...
Any hints?
Best Regards Philipp
hi,
Can u add the below lines after the catch line.
catch(Exception e ){
if(e.getMessage() != null){
System.out.println("Exception message is ::"+e.getMessage() );
}
if(e.getCause() != null){
System.out.println("Cause of the exception is ::"+e.getCause() );
}
See if that prints out a bit more...
Hope it helps
Regards
Ravi
Hello Dennis,
Thanks for the answer....
But i already know that i don't get a LoginRequest Object from my Web Service.
The Web service just returns a WebServiceNameBindingStub, this object is not castable in a LoginRequest.
My program creates a LoginRequest with the default constructor and i get the following messages:
<i>Class of LoginRequest: com.xxx.xxx.conn.proxy.types.p2.LoginRequest
HashCode of LoginRequest:21676906
LoginRequest To String: mappingInfo: auth Auth false false 11 language Language false false 11 version Version false false 11 application Application false false 00 </i>
For the Remote Object i get the following message:
<i>Class of RemoteObject: class com.xxx.xxx.conn.proxy.WebServiceNameBindingStub
HashCode of the RemoteObject: 23296339</i>
After the cast from the Remote-Object to the LoginRequest i get the following message:
<i>Caught Exception: class java.lang.ClassCastException
Message: null
Cause: null</i>
I hope that explains the situation a bit better
Message was edited by:
Philipp Kostyra
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.