Home > Ask the SOA Experts > Questions & Answers > Invoking a remote CORBA method with parameter constraints
Ask The SOA Expert: Questions & Answers
EMAIL THIS

Invoking a remote CORBA method with parameter constraints

Jeff  Hanson EXPERT RESPONSE FROM: Jeff Hanson

Pose a Question
Other SOA Categories
Meet all SOA Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 15 September 2005
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?

>

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.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Java Web Services
Video: Author says Enterprise JavaBeans is here to stay
Languages like F# may replace Java, says Ted Neward
Mobile development growing in prominence according to survey
OSGi framework helps you manage Java components
SpringSource moves VMware up the stack
SpringSource gains cloud console: Q&A with Cloud Foundry head
Adopting OSGi requires patience and money, but development flexibility results
Speed up application deployment with automated blackbox frameworks
Java Servlet API 3.0 improves application plugability
Manual configuration scripting of Java EE web applications can cause downtime

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
EmbeddedJava  (SearchSOA.com)
Java Card  (SearchSOA.com)
Java Development Kit  (SearchSOA.com)
Java Runtime Environment  (SearchSOA.com)
Java virtual machine  (SearchSOA.com)
JMX  (SearchSOA.com)
MBean  (SearchSOA.com)
Project Metro  (SearchSOA.com)
Project Tango  (SearchSOA.com)
Tomcat  (SearchSOA.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SOA Governance White Papers - BPM, EDA, IT Governance
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts