{
int id = 0 ;
// Convert IOP.service_context to core.ServiceContext:
EncapsOutputStream outputStream =
sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);
InputStream inputStream = null;
UnknownServiceContext coreServiceContext = null;
ServiceContextHelper.write( outputStream, service_context );
inputStream = outputStream.create_input_stream();
// Constructor expects id to already have been read from stream.
coreServiceContext = new UnknownServiceContext(
inputStream.read_long(),
(org.omg.CORBA_2_3.portable.InputStream)inputStream );
id = coreServiceContext.getId();
if (serviceContexts.get(id) != null)