4 Replies Latest reply on Apr 5, 2005 8:35 AM by dhartford

    Education question - literal/encoded, RPC/Document

    dhartford

      I've been trying to find a good, general reference between the four different types of WebServices.

      RPC/encoded
      RPC/literal
      Document/encoded
      Document/literal

      Please help in educating the populace with hopefully a good general understanding.

      My understandings to date, with (?) in assumption areas:

      RPC/Encoded:
      pros:
      This is the easiest to use for simple WebServices. Most tools automatically generate the basic Java2Webservice (WSDL) without too much problem. No special mapping.xml file is needed(?). No special custom-client programming needed.
      cons:
      Does not handle complex/custom java objects, arrays, etc very well at all. Not accepted for general practice, not supported for WS Basic Profile.

      RPC/Literal:
      pros:
      Most accepted type for webservices. No special client programming needed (i.e. still uses standard web-service types).
      cons:
      Usually requires a mapping.xml file, and may require additional programming for webservice understanding of complex types.

      Document/Literal & Encoding:
      I do not have much experience, but my understanding this requires custom programming on both the server and the client side. For each document webservice, the client (whether java or .net), you have to custom-write the de-marshalling side of the webservice.

      Please let me know if I'm on the right track, any corrections, and hopefully some better references. :-)

      -D

        • 1. Re: Education question - literal/encoded, RPC/Document
          mazz
          • 2. Re: Education question - literal/encoded, RPC/Document
            md5georg

            Hello,

            A month ago I asked the same question and I have spent quite some time digging out the information needed to understand this also. The two best articles I found are these

            http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/

            and

            http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/html/rpc_literal.asp


            The main differens between RPC and Document styles are that in RPC style all objects that you send back and forth are predetermind by a descriptive schema that lays elsewhere. In Document style, the object structure is included in the WSDL, so you can describe whatever you want (it must still confirm to a schema, but a more general).

            For both RPC and Document style, you do not have to code any serializer/deserialiser if you use objects that follows plain old java code and Bean standards. Everything can be automatically produced with the wscompile tool delivered with Sun's JWSDP 1.5. In that case you can swap between RPC and Document very easy and with a minimal amout of changes in the client access code (I have just done this in our web service since .Net does not support RPC style). I guess there is more to it with Document style, more strengths you can use, but my knowledge of that is at a minimum.

            The links above describes the differences in more details. Hope this helps.

            Best regards

            Georg

            • 3. Re: Education question - literal/encoded, RPC/Document
              md5georg

              Oh... I forgott. On the .Net side (if you are going to use that), in Visual Studio 2003, you point out a WSDL file and the program takes care of the code generation and compilation. You just use the generated classes and structures directly... Very easy. I guess there is some similar tools for the java side as well.

              /Georg

              • 4. Re: Education question - literal/encoded, RPC/Document
                dhartford

                great responses and references, thank you!!

                md5georg, I confirm some of the warnings regarding .NET compatibility. RPC/encoded seems to work flawlessly (for the simple cases), while RPC/literal doesn't seem to play nicely.

                The Document Literal does work, just a different way of thinking (and extra object creation it seems on the Client side). Document Literal/Wrapped looks cool, but I do not see any support from the Java camp just yet on it.

                One of my posts has to do with how to create RPC/Enc, RPC/lit, and Doc/lit webservices from the same EJB Bean, hopefully that will prove enlightening for all services. :-)

                Again, thanks everyone!

                -D