<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Casting Problems Remote to Custom Object in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138803#M931602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could u please post detailed stack trace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Apr 2007 15:10:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-02T15:10:24Z</dc:date>
    <item>
      <title>Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaq-p/2138802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm want to consume a WebService in my app. According to the Tutorial on this link: &lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0cac0dea-0d01-0010-edb4-8c7b068f4677" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0cac0dea-0d01-0010-edb4-8c7b068f4677&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the Service does not answer with the right object. I only receive this javax.rmi.Remote Interface Object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do i have to do to cast this Remote Object into the described object? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would be very happy to get an answer on that!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 14:48:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaq-p/2138802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T14:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138803#M931602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could u please post detailed stack trace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 15:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138803#M931602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T15:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138804#M931603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Denis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i just received a ClassCastException, nothing else ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is nothing in the StackTrace. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MyWebService myws = WebserviceConnection.initiate();
Remote remObj = myws.getLogicalPort(logicalPorts&amp;lt;i&amp;gt;,logReq.getClass());
logReq = (LoginRequest) remObj;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; --&amp;gt; Here i get the Exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole method is surrounded by an try-catch-block!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's more a programming skill thing than a technical problem. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 15:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138804#M931603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T15:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138805#M931604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check if &amp;lt;i&amp;gt;logReq.getClass()&amp;lt;/i&amp;gt; returns class &amp;lt;i&amp;gt;LoginRequest&amp;lt;/i&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 06:16:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138805#M931604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T06:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138806#M931605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning Denis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i checked if &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;logReq.getClass()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; returns the Class &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LoginRequest&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; and it does. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm now trying to implement the Remote interface to my custom-class. We will see if it works.  If you have some idea please respond. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help. &lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 07:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138806#M931605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T07:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138807#M931606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a pity. The java.rmi.Remote - Interface is not a valid interface for the usage in a proxy. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm always interested in new ideas....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 07:30:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138807#M931606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T07:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138808#M931607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. proxy is generated by NWDS - u should NOT change it&lt;/P&gt;&lt;P&gt;2. there should be apropriate method to get logical port without specifying name and class - try them first&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so study generated classes carefully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 11:19:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138808#M931607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T11:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138809#M931608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Denis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. i didn't touch the proxy. &lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to call on of these methodes with and without logicalportname but without success...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 13:44:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138809#M931608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T13:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138810#M931609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u add the below lines after the catch line.&lt;/P&gt;&lt;P&gt;catch(Exception e ){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(e.getMessage() != null){&lt;/P&gt;&lt;P&gt;System.out.println("Exception message is ::"+e.getMessage() );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;if(e.getCause() != null){&lt;/P&gt;&lt;P&gt;System.out.println("Cause of the exception is ::"+e.getCause() );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if that prints out a bit more...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 17:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138810#M931609</guid>
      <dc:creator>ravi_raman2</dc:creator>
      <dc:date>2007-04-03T17:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138811#M931610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Caught Exception: class java.lang.ClassCastException &lt;/P&gt;&lt;P&gt;Message:              null &lt;/P&gt;&lt;P&gt;Cause:                  null &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't make any sense to me that i don't get any messages from the Exception!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you a hint....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards &lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 16:41:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138811#M931610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-04T16:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138812#M931611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found out that the object i receive from the Proxy is a BindingStub Object, that implements Remote.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i still have the problem that it is impossible to cast this object in another object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really don't know what i could do right now!??!??! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 17:18:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138812#M931611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-04T17:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138813#M931612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The remObj is not type of LoginRequest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to prove it, put the following lines before the casting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
If ( remObj instanceof LoginRequest )
{
     // do something
}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to find other ways to get what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dennis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 19:05:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138813#M931612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-04T19:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Casting Problems Remote to Custom Object</title>
      <link>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138814#M931613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dennis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i already know that i don't get a LoginRequest Object from my Web Service. &lt;/P&gt;&lt;P&gt;The Web service just returns a WebServiceNameBindingStub, this object is not castable in a LoginRequest.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My program creates a LoginRequest with the default constructor and  i get the following messages: &lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Class of LoginRequest: com.xxx.xxx.conn.proxy.types.p2.LoginRequest&lt;/P&gt;&lt;P&gt;HashCode of LoginRequest:21676906&lt;/P&gt;&lt;P&gt;LoginRequest To String: &lt;SPAN __jive_macro_name="http"&gt;&lt;/SPAN&gt; mappingInfo: auth Auth false false 11 language Language false false 11 version Version false false 11 application Application false false 00 &amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the Remote Object i get the following message: &lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Class of RemoteObject: class com.xxx.xxx.conn.proxy.WebServiceNameBindingStub&lt;/P&gt;&lt;P&gt;HashCode of the RemoteObject: 23296339&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the cast from the Remote-Object to the LoginRequest i get the following message:&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Caught Exception: class java.lang.ClassCastException &lt;/P&gt;&lt;P&gt;Message: null &lt;/P&gt;&lt;P&gt;Cause: null&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that explains the situation a bit better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Philipp Kostyra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 07:47:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/casting-problems-remote-to-custom-object/qaa-p/2138814#M931613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T07:47:53Z</dc:date>
    </item>
  </channel>
</rss>

