Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

String_To_Object – PB Docs 125 – PowerBuilder Library

String_To_Object – PB Docs 125

String_To_Object PowerScript function

Description

Gets an object reference based on a passed string.

This function is used by PowerBuilder clients connecting to EAServer.

Controls

JaguarORB objects

Syntax

Argument

Description

jaguarorb

An instance of JaguarORB.

objstring

A string that represents a CORBA object.

The string representation of a CORBA object is an Interoperable
Object Reference (IOR) that describes how to connect to the server
hosting the object. EAServer supports both
standard format IORs (which are hex-encoded) and a URL format that
is human-readable.

object

A variable of type CORBAobject that will
contain the object reference.

Return Values

Long. Returns 0 if it succeeds and a
negative number if an error occurs.

Usage

The String_To_Object function
allows you to instantiate a proxy instance without using the Jaguar
naming service.

note.png Connecting to EJB components

In PowerBuilder 7 and earlier releases, the JaguarORB String_To_Object function
was used to access EJB components in EAServer.
In PowerBuilder 8 and later, the Lookup function on the Connection object
can be used to instantiate a proxy for the home interface of an
EJB component in EAServer.

In PowerBuilder 9, the Lookup function on the EJBConnection
PowerBuilder extension object can be used to instantiate proxies
for EJB components running in any J2EE-compliant server.

When you use String_To_Object for proxy
instantiation, you instantiate the object directly. The disadvantage
of this approach is that you lose the benefits of server address
abstraction that are provided by the naming service.

To use the naming service API explicitly, you can use the Resolve_Initial_References function
to obtain an initial naming context. However, this technique is
not recommended because it requires use of deprecated SessionManager::Factory
methods. For more information about connecting to EAServer using the JaguarORB
object, see Application Techniques.

The String_To_Object can
be used to obtain an EAServer authentication manager
instance by using a URL format IOR. IOR strings in URL format must
have the form:

where:

  • protocol is iiops if
    connecting to a secure port and iiop otherwise

  • host is the EAServer host address or machine
    name

  • iiop_port is the port
    number for IIOP requests

An example of a URL-format IOR is:

If the server is part of a cluster, the objstring argument
can contain a list of IORs separated by semicolons.

After calling String_To_Object,
you can use the Manager interface to obtain an instance of the Session
interface, which allows you to create component instances. When
you use the Manager and Session interfaces, you need to generate
proxies for these interfaces and include these proxies in the library
list for the client. For information about methods on these interfaces,
see the interface repository documentation at the URL http://yourhost:yourport/ir/, where yourhost is
the server’s host name and yourport is
the HTTP port number.

The String_To_Object function
can also be used to deserialize a Proxy object reference. By serializing
an object reference, you can save the state of the object so that
it persists after the client terminates processing. Deserializing
the object reference gets an object reference from a serialized
string. String_To_Object is
often used in conjunction with Object_To_String,
which allows you to serialize an object reference.

Examples

The following example shows the use of the String_To_Object function
to obtain an EAServer authentication
manager instance. The function uses a URL format IOR:

In this example, the component is an EJB component.
When the _Narrow function is called
to convert the object reference returned from the Lookup call on
the Session object, the second argument includes the domain name
as well as the package name. This is necessary if the Java package
name uses the domainname.packagename format:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x