* smallest(profGIOPVersion, orbGIOPVersion)
*/
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {
GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
IIOPProfile prof = ior.getProfile() ;
GIOPVersion profVersion = prof.getGIOPVersion();
// Check if the profile is from a legacy Sun ORB.
ORBVersion targetOrbVersion = prof.getORBVersion();
if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
// we are dealing with a SUN legacy orb which emits 1.1 IORs,
// in spite of being able to handle only GIOP 1.0 messages.
return V1_0;