Creating Dynamic EJB Proxies to JAX-RPC External WebServices using the Dynamic Invocation Interface (DII)

As a follow up to the last blog entry, how can we handle a situation where we do not have access to the WSDL at runtime or we need to change the value of the endpoint dynamically at runtime.

Well for JAX-RPC webservices we can use the Dynamic Invocation Interface (DII).....

Using the same concept as the last blog entry, wrapping the DII code inside an EJB, exposed as a doc/literal webservice, is a simple way to create a proxy to these external webservices, this EJB-WS can then be called from BPEL, for example, via the JavaEE SE making the overall process very efficient.

So, how do we do this........

1. Use the same example RPC/encoded webservice - this one

2. Create a EJB project inside NetBeans

3. Create a WSDL to expose your EJB as a webservice

4. Again, Do not create a WebService Client - this is an un-necessary step, we will do this dynamically in the code

5. Start coding, the code below can be used to call the above webservice and respond with the quotation string, pay special note to how the qualified names for the serviceName and portName are constructed and how they relate to the underlying WSDL.....

6. Attached is the EJB project. To test just create a WS client from the EJB-WS.

Enjoy....

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Mark Foster, Obernai, France

I work for Sun in a team called FAST helping to enable the open source community for Open ESB.

Search

Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today