Invoking a remote CORBA method with parameter constraints

Invoking a remote CORBA method with parameter constraints

I am writing a Java DII Client, which reads the information from the Interface Repository. I have to execute one remote method which has one parameter of out type which is a user-defined data-type. How can I build the request, invoke the operation and read the results? As of now I am able to read the parameter name, parameter type and number of parameters of the method. I tried constructing the dynstruct using the dynamic factory but it doesn't work. How do I send the user-defined data type as an out parameter to the CORBA Method?

    Requires Free Membership to View

    When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to keep you informed on recent service-oriented architecture (SOA) and SOA-related topics such as integration, governance, Web services, Cloud and more.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSOA.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSOA.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

This is a good question, since the J2EE dynamic invocation interface (DII) client model allows access to an RPC-based Web service even if the details of the service are unknown prior to runtime. To create a DII client, follow these steps:

1: Create a Service object using the javax.xml.rpc.ServiceFactory class as follows:

   ServiceFactory factory = ServiceFactory.newInstance();

   Service service =  factory.createService(new QName(theServiceQName));

2: From the Service object, create a Call object as follows:

   QName port = new QName(theQNnamePort);   

   Call call = service.createCall(port);

3: Set the service endpoint address on the Call object corresponding to the element of the WSDL file as follows:

   call.setTargetEndpointAddress(theEndpointAddress);

4: Set the appropriate properties on the Call object.

5: Specify the method's return type, name, and parameter as follows:

   QName qNameRetType = new QName(NS_XSD, "theXSDType");
   call.setReturnType(qNameRetType);
   call.setOperationName(new QName(theOperationNamespaceValue,
                         "theOperationName"));

   call.addParameter("String_1", QNAME_TYPE_STRING,
ParameterMode.IN);

6: Invoke the remote method on the Call object as follows:

   String[] params = { "param1" };
   String result = (String)call.invoke(params);

Details for this scenario can be found at in the J2EE tutorial.

This was first published in September 2005