views:

456

answers:

4

In other platforms can I develop a service without worrying about addresses and bindings? What is the name of equivalent technologies for Java, Python and other environments?

Edit: For those who are unfamiliar with WCF, this is a part of the .NET 3.x framework whose main feature is to enable developing services that can answer multiple protocols and addresses simultaneously (optionally), without requiring from the developer to write a single line of code concerning those protocols. The address/protocol setting is controlled by a XML configuration file (or programatically if you wish).

A: 

The closet thing I can think of for Java is Apache Axis2. It's primarily designed for web services (SOAP/REST) but it's transport protocol is pluggable to an extent.

joemoe
A: 

In Java, similar functionality is provided by J2EE application servers (JAX-WS/SOAP and Corba/IIOP is mandated by the J2EE specification, most app servers provide additional proprietary remoting protocols) or Spring Remoting (with included support for RMI, Hessian, Burlap, JAX-RPC and a proprietary HTTP based protocol).

Both approaches are however not entirely transparent to the implementation, since most protocols enforce specific restrictions or requirements to the service interfaces and/or objects used as function arguments and return values. E.g. JAX-WS may require the services and argument/response types to be annotated with JAX-WS or JAXB annotations, IIOP services must adhere to the IIOP to Java binding specifications, RMI require argument/response types to be serializable and Hessian/Burlap also have their own restrictions on which types are allowed.

jarnbjo
+2  A: 

The https://wsit.dev.java.net/ project from Sun is an initiative to allow WCF and Java Web Services to work together nicely. Microsoft and Sun worked together on the project to try and ensure that as much as possible, WCF and Java webservices would work together.

Based on the JAX-WS standard, the definition (and consumption) or webservices are seperate concerns. For example, the WSIT tutorial defines the following web service:

@WebService() public class Calculator {   
    @WebMethod(action="sample_operation")  
    public String operation(@WebParam(name="param_name")

      String param) {
    // implement the web service operation here
    return param;   }

  @WebMethod(action="add")   public int add(@WebParam(name = "i") int i, 
      @WebParam(name = "j") int j) {
    int k = i + j; 
    return k;   } }

Which makes no reference to the transport defintion - This is define separately at deploy time (or programatically if you wish).

Other transports can be used in place of HTTP, for example, the jms-ws-transport project can be used to invoke web services over a JMS transport.

At JavaOne 2008, Microsoft and Sun co hosted a session on web service interop. I asked if there were any plans to support the NetTCPBinding for Interop. The Microsoft representative said that there had been no client demand for this, but if there was, he could see no reason not to support this.

Robert Christie
+1  A: 

So long as you want to abstract over TCP/UDP/multicast, you can have a look at these:

  • JBoss Netty
  • Apache MINA
  • Grizzly
  • xSocket

Your mileage may vary. I was particularly impressed by Netty, but I've also heard of good experiences with MINA.

nadavwr