ORB::string_to_object

Overview Converts a string (produced by CORBA::ORB::object_to_string) into an object reference.
Original class CORBA::ORB
Exceptions If the input string is not valid, or refers to a local object that is no longer valid (insofar as the ORB can determine), a CORBA::SystemException is thrown.


Intended Usage

The ORB::string_to_object method is intended to be used by client or server applications to convert a string form of an object reference into an object. The string may be one of the Object URLs form or it may be a stringified object reference (IOR) generated by calling the CORBA::ORB::object_to_string method.

If the string is an IOR, then string_to_object behaves as follows:

Syntax

CORBA::Object_ptr string_to_object (const char* str);

Input parameters

str
A string form of an object reference. This string is either an object URL or it must have been originally generated using ORB::object_to_string (although not necessarily by the process). The caller retains ownership of this string.

Return values

CORBA::Object_ptr
The object reference encoded by the input string. The caller assumes ownership of this object reference and should subsequently release it using CORBA::release.

Example

#include "corba.h"
#include   ...
// Assume op initialized elsewhere
//
extern CORBA::ORB_ptr op;
//
// Let fstr be an object URL string of file type.  The file should
// contain another object reference, typically an IOR.
// 
const char * fstr = "file://c:\objs\aUrl.txt";
CORBA::Object_ptr objPtr = op->string_to_object(fstr);
...
//
// Let ns be an object URL corbaloc string representing the Naming Service
// 
const char * ns = "corbaloc:rir:/NameService";
CORBA::Object_ptr ns_objPtr = op->string_to_object(ns);
...

Also see the example in ORB::object_to_string.


Related reference
CORBA module



Searchable topic ID:   rcor_modo33
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_modo33.html

Library | Support | Terms of Use | Feedback