• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JAX-WS dynamic proxies and increased platform independence

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the advantages of JAX-WS over JAX-RPC is that has increased platform through the use of dynamic proxies.
In real terms what does this mean? Does it mean you can move the WebService over different AppServers where with JAX-RPC this was more hassel? If not what exactly is the platform independence?

Thanks.

 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Luke,

In real terms what does this mean?


JAX-WS overcomes few shortcomings and incompatabilities of JAX-RPC to make web services more platform independent(platform independence doesn't really sound as it is, as if we dump the web service archive created in Java platfrom on to .NET to make it work. But, to state web service created on one platform can be invoked from another, thus making it more interoperable among various programming languages). This IBM link has a good amount of information on the differences.http://www.ibm.com/developerworks/webservices/library/ws-tip-jaxwsrpc.html
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Naren Chivukula wrote:Hi Luke,

In real terms what does this mean?


JAX-WS overcomes few shortcomings and incompatabilities of JAX-RPC to make web services more platform independent(platform independence doesn't really sound as it is, as if we dump the web service archive created in Java platfrom on to .NET to make it work. But, to state web service created on one platform can be invoked from another, thus making it more interoperable among various programming languages). This IBM link has a good amount of information on the differences.http://www.ibm.com/developerworks/webservices/library/ws-tip-jaxwsrpc.html


I get the general advantages of JAX-WS. I do not get what they mean by "platform indepedence". Can you give a few examples of platforms and how JAX-WS is independent of them?

Thanks.
 
Naren Chivukula
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Luke,
Who are "they" you are referring to? Can you point us to any link?
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From IBM

Java™ API for XML-Based Web Services (JAX-WS), which is also known as JSR-224, is the next generation Web services programming model that extends the foundation provided by the Java API for XML-based RPC (JAX-RPC) programming model. Using JAX-WS, developing Web services and clients is simplified with *greater platform independence for Java applications by the use of dynamic proxies* and Java annotations. The Web services tools included in this product support JAX-WS 2.0 and 2.1.

See here
 
Greenhorn
Posts: 15
Oracle VI Editor Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Luke Murphy wrote:One of the advantages of JAX-WS over JAX-RPC is that has increased platform through the use of dynamic proxies. In real terms what does this mean? ...



rtfm-snippet:

The static client programming model for JAX-WS is the called the Dynamic Proxy client. The Dynamic Proxy client invokes a Web service based on a Service Endpoint Interface (SEI) which must be provided. The Dynamic Proxy client is similar to the stub client in the Java API for XML-based RPC (JAX-RPC) programming model. Although the JAX-WS Dynamic Proxy client and the JAX-RPC stub client are both based on the Service Endpoint Interface (SEI) that is generated from a WSDL file , there is a major difference. The Dynamic Proxy client is dynamically generated at run time using the Java 5 Dynamic Proxy functionality, while the JAX-RPC-based stub client is a non-portable Java file that is generated by tooling. Unlike the JAX-RPC stub clients, the Dynamic Proxy client does not require you to regenerate a stub prior to running the client on an application server for a different vendor because the generated interface does not require the specific vendor information.

The Dynamic Proxy instances extend the java.lang.reflect.Proxy class and leverage the Dynamic Proxy function in the base Java Runtime Environment Version 5. The client application can then provide an interface that is used to create the proxy instance while the runtime is responsible for dynamically creating a Java object that represents the SEI.

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulli Hertlein wrote:

Luke Murphy wrote:One of the advantages of JAX-WS over JAX-RPC is that has increased platform through the use of dynamic proxies. In real terms what does this mean? ...



rtfm-snippet:

The static client programming model for JAX-WS is the called the Dynamic Proxy client. The Dynamic Proxy client invokes a Web service based on a Service Endpoint Interface (SEI) which must be provided. The Dynamic Proxy client is similar to the stub client in the Java API for XML-based RPC (JAX-RPC) programming model. Although the JAX-WS Dynamic Proxy client and the JAX-RPC stub client are both based on the Service Endpoint Interface (SEI) that is generated from a WSDL file , there is a major difference. The Dynamic Proxy client is dynamically generated at run time using the Java 5 Dynamic Proxy functionality, while the JAX-RPC-based stub client is a non-portable Java file that is generated by tooling. Unlike the JAX-RPC stub clients, the Dynamic Proxy client does not require you to regenerate a stub prior to running the client on an application server for a different vendor because the generated interface does not require the specific vendor information.

The Dynamic Proxy instances extend the java.lang.reflect.Proxy class and leverage the Dynamic Proxy function in the base Java Runtime Environment Version 5. The client application can then provide an interface that is used to create the proxy instance while the runtime is responsible for dynamically creating a Java object that represents the SEI.



I have read that before. That's really the "how" , I am looking more for the "What"?

What does it mean by platform independence? I don't care they use dynamic proxies under the hood. What does "platform independence" mean in the big picture?
 
Naren Chivukula
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Luke,
To be honest, I can't say I comprehended well. However, as referred in the article JAX-RPC uses stub generation model for most of its web service clients. This is mainly due to the fact the IDEs provided an easy way to deal with stub generation. Though, Dynamic Proxies are little used in JAX-RPC (because of manual programming and thereby lengthy development times), it seems usage of Dynamic Proxies are exploited in JAX-WS following "Java 5 dynamic proxy functionality", which comes under JRE rather than any dependency on the server library APIs. Thus, making JAX-WS platform independent(platform might refer to operating system or server JVM) to generate Dynamic Proxies over JAX-RPC.
 
Ulli Hertlein
Greenhorn
Posts: 15
Oracle VI Editor Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Luke Murphy wrote:I have read that before. That's really the "how" , I am looking more for the "What"? What does it mean by platform independence? I don't care they use dynamic proxies under the hood. What does "platform independence" mean in the big picture?



...the Dynamic Proxy client does not require you to regenerate a stub prior to running the client on an application server for a different vendor....

it seems to be that a jax-ws client is portable across platforms, e.g. a swing client (or applet) which contains a jax-ws based client for c/s communcation should run OOB on several OS
and for a jax-rpc client some artefacts has to be build/provided for the client to work on another platform.
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Naren Chivukula wrote:Hi Luke,
To be honest, I can't say I comprehended well. However, as referred in the article JAX-RPC uses stub generation model for most of its web service clients. This is mainly due to the fact the IDEs provided an easy way to deal with stub generation. Though, Dynamic Proxies are little used in JAX-RPC (because of manual programming and thereby lengthy development times), it seems usage of Dynamic Proxies are exploited in JAX-WS following "Java 5 dynamic proxy functionality", which comes under JRE rather than any dependency on the server library APIs. Thus, making JAX-WS platform independent to generate Dynamic Proxies over JAX-RPC.



Thanks for your comments Naren. But it doesn't answer my question. I am not interested in the implementation detail in this case, I want to know what difference from a black box perspective the platform independence makes?

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulli Hertlein wrote:

Luke Murphy wrote:I have read that before. That's really the "how" , I am looking more for the "What"? What does it mean by platform independence? I don't care they use dynamic proxies under the hood. What does "platform independence" mean in the big picture?



...the Dynamic Proxy client does not require you to regenerate a stub prior to running the client on an application server for a different vendor....

it seems to be that a jax-ws client is portable across platforms, e.g. a swing client (or applet) which contains a jax-ws based client for c/s communcation should run OOB on several OS
and for a jax-rpc client some artefacts has to be build/provided for the client to work on another platform.



Ok so platform you mean operating systems?

I am not sure about this. The platform independence there is supposed to be in the JVM.

Thanks for you comments but I don't think we are quite there yet. At least I am not.
 
Naren Chivukula
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I want to know what difference from a black box perspective the platform independence makes?


All I can say is that there is no need to necessarily have a server running for JAX-WS web services because installing JRE is enough! Thus making them platform independent, which is not the case for JAX-RPC.
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok here's my guess...

By platform independence what is meant it can support multiple implementations of JAX-WS.

So you could use the reference implementation or Axis2 and not have to regenerate any stubs for your client.
It achieves this by using dynamic proxies in the implementation.

If I am correct vendor independence would be a better term than platform independence (which implies OS).

If I am wrong, I think what the mean by platform indepence is the transport protocol, i.e you can use HTTP, FTP, SMTP, JMS without having to regenerate the client. I do not think it is the operating system. in terms oone JVM on linux the other on Windows. This is solved by the JVM not JAX-WS.

According to this: http://www.kanakavaranasi.com/technology/j2ee/jaxws/jax-ws/
JAX-WS platform independences means a JAX-WS JAva WebService can talk to a non Java WebService e.g. something implemented in .net?

Surely this was possible with JAX-RPC?

Getting very confused now...

Any more comments? Good discussion...
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got another good link on this from IBM...

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/cwbs_jaxwsclients.html


The Dynamic Proxy client is dynamically generated at run time using the Java 5 Dynamic Proxy functionality, while the JAX-RPC-based stub client is a non-portable Java file that is generated by tooling. Unlike the JAX-RPC stub clients, the Dynamic Proxy client does not require you to regenerate a stub prior to running the client on an application server for a different vendor because the generated interface does not require the specific vendor information.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure why someone combined both terms "platform in-dependency" and "dynamic proxies". Dynamic proxies allows you to generate the stubs every time the request is made and thus making sure your client is in sync with the latest WSDL where as in static proxy client will be working against the already generated stubs.

For more information http://jaitechwriteups.blogspot.com/2007/04/webservice-client-using-dynamic-proxy.html
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic