* this will write
*/
public GIOPOutputStream startRequest(GIOPVersion version,
InternalTargetAddress targetAddress, ClientInvocation inv,
byte[] principal) throws IOException {
InternalServiceContextList contextList = inv
.getRequestServiceContextList();
byte response_flags = inv.getResponseFlags();
String operation = inv.getOperation();
RequestID requestID = getNextRequestID();
inv.setRequestID(requestID);
// acquire output channel token
OutputChannel outputChannel = transport.getOutputChannel();
GIOPOutputStream out = new GIOPOutputStream(orb, outputChannel, version);
// this will write a GIOP message header
out.beginGIOPStream(MsgType_1_1._Request, requestID);
// add stuff like character encoding, and
// sending context rumtine service contexts...
add_outgoing_system_contexts(contextList);
// now write the request
switch (version.minor) {
case 0:
case 1:
// Write RequestHeader_1_1
{
contextList.write(out);
out.write_long(requestID.value());
switch (response_flags) {
case SYNC_NONE:
case SYNC_WITH_TRANSPORT:
out.write_boolean(false);
break;
case SYNC_WITH_SERVER:
case SYNC_WITH_TARGET:
out.write_boolean(true);
break;
}
out.skip(3);
targetAddress.writeObjectKey(out);
if (principal == null) {
out.write_long(0);
} else {
out.write_long(principal.length);
out.write_octet_array(principal, 0, principal.length);
}
}
case 2:
// Write RequestHeader_1_2
{
out.write_long(requestID.value());
out.write_octet(response_flags);
out.skip(3); // can be dropped, target address aligns anyway
targetAddress.write(out);
out.write_string(operation);
contextList.write(out);
out.setInsertHeaderPadding(true);
break;
}