Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes How to determine if it is Document style or RPC looking at SOAP request ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "How to determine if it is Document style or RPC looking at SOAP request ?" Watch "How to determine if it is Document style or RPC looking at SOAP request ?" New topic
Author

How to determine if it is Document style or RPC looking at SOAP request ?

Rajani Gummadi
Ranch Hand

Joined: Dec 17, 2010
Posts: 48
Hi All,

I have my class defined as



For this the SOAP request and SOAP Response taken from Glassfish testing facility is as follows


I repeated the test by changing the style to RPC in @SOAPBinding annotation and the when I looked into SOAP request and response, they look exactly the same as above.

In such case, is it actually possible to determine the style being used by looking solely at SOAP request/response. I have this question as I actually saw a similar question in one of the mock tests.

How to determine, if a SOAP request and response belongs to RPC or Document style, when WSDL or @SOAPBinding annotation is not given in a question ?
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3199
    
    5
  • The document-wrapped adds one "wrapper" element around parameters (so request looks like valid XML and can be valiadted against schemas). RPC-style also has operation name as parent element (i.e. wrapping element) for method parameters elements. So, you won't notice any difference looking at SOAP request for document-wrapped and RPC style web service.
  • You can notice difference if you compare RPS style with bare document style. In this case document style won't have operation name in SOAP message.
  • You can find out difference between document-wrapped and RPC by looking at WSDL


  • Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
    Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
    Rajani Gummadi
    Ranch Hand

    Joined: Dec 17, 2010
    Posts: 48
    Mikalai Zaikin wrote:

  • [list]You can notice difference if you compare RPS style with bare document style. In this case document style won't have operation name in SOAP message.



  • Thanks Mikalai,

    What is RPS style. Is this same as RPC. For testing this RPS with Bare, I need to have only one parameter for the method call. Am I right?
    Mikalai Zaikin
    Ranch Hand

    Joined: Jun 04, 2002
    Posts: 3199
        
        5
    Rajani Gummadi wrote:
    Mikalai Zaikin wrote:

  • [list]You can notice difference if you compare RPS style with bare document style. In this case document style won't have operation name in SOAP message.



  • Thanks Mikalai,

    What is RPS style. Is this same as RPC. For testing this RPS with Bare, I need to have only one parameter for the method call. Am I right?


    Your assumption is correct - RPC (I mistyped).
    Method for PRC web service may have as many parameters as required, not only one.
    Dan Drillich
    Ranch Hand

    Joined: Jul 09, 2001
    Posts: 1167
    Looking at Which style of WSDL should I use?, you can see, as Mikalai pointed out to, that your SOAP request is either RPC/literal or Document/literal wrapped.

    Regards,
    Dan


    William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
     
    wood burning stoves
     
    subject: How to determine if it is Document style or RPC looking at SOAP request ?
     
    Similar Threads
    Why do I see different wsdl and xsd generated for webservice through wsgen.
    Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest
    Web Service doesn't read my parameter
    Unable to send a SOAP request properly designed using SAAJ
    org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement