'Invalid object for method' error calling jaguar component method

I am attempting to call a jaguar component method that has an string
argument defined as INOUT. The component has been created in PowerBuilder
where the argument is passed by reference. I am able to call the
java.CreateComponent successfully but when the component method is called
the following error is generated in my browser:

Invalid object for method doSomething near line 34 in "/test.htm"

Here is the code segment from my server script in the test.htm page:

<%
....
test = java.CreateComponent("fts/test", "iiop://localhost:9000", "jagadmin",
"");
if (test == null) {
  psDocument.WriteLn(" NULL test component!<BR>");
  exit;
}

errString = "";
rc = test.doSomething(errString);
                                        ^^ -- this is causing the error
....
%>

How can I define the string variable in my server script to be used as an
INOUT argument to my component method?

Any help will be greatly appreciated. Thanks.

Richard J. Ettema
Senior Consultant
AEGIS Consulting
richard.ettema@aegisconsulting.com





0
Richard
12/28/1999 2:39:51 PM
sybase.easerver 11371 articles. 0 followers. Follow

1 Replies
358 Views

Similar Articles

[PageSpeed] 1

This error indicates that you did not pass the correct type.

For reference arguments, you must use the type's holder equivalent.
In this case, it is org.omg.CORBA.StringHolder.  Every holder has a
public attribute called value of the type that you want to pass.  In
this case, value is, of course, type String.  Since StringHolder is a
class, you must create a local instance of the class and then pass it
to the the method.

/*
note the constructor initializing the value propert
this was necessary in some versions of Jaguar
*/
myHolder = java.CreateObject("org.omg.CORBA.StringHolder", "");

rc = test.doSomething(myHolder);

From here, you will need to use Dave's reflection classes to get at
"value".  There are many posts on this subject on this newsgroup.


Carson


___________________________________________________________

Carson Hager
Team Sybase
Dynamic Data Solutions, Inc.
Enterprise Application Studio 3.0 Consulting and Training

               DDS Enterprise Application Framework
                      Available Now as Open Source!
                          http://www.dyn-data.com

On Tue, 28 Dec 1999 09:39:51 -0500, "Richard J. Ettema"
<richard.ettema@aegisconsulting.com> wrote:

>I am attempting to call a jaguar component method that has an string
>argument defined as INOUT. The component has been created in PowerBuilder
>where the argument is passed by reference. I am able to call the
>java.CreateComponent successfully but when the component method is called
>the following error is generated in my browser:
>
>Invalid object for method doSomething near line 34 in "/test.htm"
>
>Here is the code segment from my server script in the test.htm page:
>
><%
>...
>test = java.CreateComponent("fts/test", "iiop://localhost:9000", "jagadmin",
>"");
>if (test == null) {
>  psDocument.WriteLn(" NULL test component!<BR>");
>  exit;
>}
>
>errString = "";
>rc = test.doSomething(errString);
>                                        ^^ -- this is causing the error
>...
>%>
>
>How can I define the string variable in my server script to be used as an
>INOUT argument to my component method?
>
>Any help will be greatly appreciated. Thanks.
>
>Richard J. Ettema
>Senior Consultant
>AEGIS Consulting
>richard.ettema@aegisconsulting.com
>
>
>
>
>

___________________________________________________________

Carson Hager
Team Sybase
Dynamic Data Solutions, Inc.
Enterprise Application Studio 3.0 Consulting and Training

               DDS Enterprise Application Framework
                      Available Now as Open Source!
                          http://www.dyn-data.com

0
chager
12/28/1999 3:04:08 PM
Reply: