This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In a nutshell speaking ,the difference between Dynamic Proxy and Generated Stub is the implementation of Remote Interface,since the Remote Interface of Dynamic Proxy is generated dynamically at runtime. (Remember that Generated Stub is generated during deployment time by JAX-RPC compiler ,which generates both remote interface (called Endpoint Interface) and stub ,which implements corresponding remote interface.) The Stub of Dynamic Proxy is generated while "javax.xml.rpc.Service.getPort()" was executed. ============================================================= DII (It's acronyms for "Dynamic Invocation Interface") can invoke web service operation without using remote interface or stub. Because you can directly get a reference to the web service by using "javax.xml.rpc.Service.createCall()". (The things you should know are either "port" name or "operation" name.) QName portName = new QName("http://blablabla","Foo"); Call call=createCall(portName); Object inputs = new Object(1); String name=(String)call.invoke(inputs);
================================================== Worawisut P. [ May 10, 2004: Message edited by: Worawisut P. ] [ May 10, 2004: Message edited by: Worawisut P. ]
This is a late add, feel free to add any updates.....
Web Services can be invoked in three different ways
1. Using Generated Stub
2. Using Dynamic Proxies
3. Using Dynamic Invocation Interface (DII)
In Generated Stub, client depends on generated interfaces of service (last block in WSDL) and portType (business definition), and their implemented stub & proxy classes. The code need to create the specific service from generated stub, and get its specific portType object from it. Then call business method
In Dynamic Invocation Interface, client does not care about the generated service stub, but creates the framework “Service” object by passing the actual service name. From the framework Service object, the client gets the generated portType object by passing the portType name. Then call the business method on the portType object
In Dynamic Invocation Interface (DII), the client does not use any generated class. It creates a Service object, and creates a Call object out of it. To the call object, client sets the name of Service, name of portType and invoke it by passing an Object array of parameters.
In short, Generated Stub uses all generated classes
Dynamic Proxy uses only generated portType
DII does not use any generated classes