• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Diff b/w RPC / Document / MSG Style

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for opening this.

I am a beginner to web service and i have a basic question.

What a web service style is all about.

and i heard that there are some style's like RPC, Document, Message..

Can any one tell me what is the difference b/w these and how does the style going to decide the web service.


Appreciate speedy response.

Thanks
- R
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The style for a SOAP message can be RPC or Document, not sure where Message style comes in.

RPC means that the body of the SOAP message represents a Remote Procedure Call, with procedure name and in and out parameters - i.e. think of it as invoking a method provided by the webservice.

Document means that the body of the SOAP message is an XML document to be sent to the service, the document could still be thought of as the parameter to a procedure call, but its more flexible in what is sent and how its interperated by the web service.

Not a speedy response, but since no one else has replied I thought I'd have a go, note that this is just my understanding - feel free to correct me if its wrong
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there
Read the good article from IBM developerworks.

http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/

regds
amit
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael,

You said, "Document means that the body of the SOAP message is an XML document to be sent to the service..."

Does that mean for Document style we have to do mashalling/unmarshalling of
xml doc? I am using Webspheres SOAP runtime engine
Thanks
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think thats right, something has to do the translation from XML in a HTTP message to something meaningful to the code implementing the webservice.

If its RPC style then JAX-RPC can be used to handle the translation between XML and parameters/return values for a method call.

If its document style the code implementing the webservice will need to handle the XML contained in the SOAP body and produce any XML required to be returned in the body. The SAAJ API could still be used to deal with the SOAP messages as a whole though - just contents of the SOAP body (the "document") that would need to be delat with.

I don't know anything about Websphere though, but think the above will still be true.
 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My web service is going to interface a .net client ( VB.net), what do you think is the best messaging style, considering the interoperability and also the disadvantages of Marshalling/Unmarshalling?

Thanks Michael
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's various advantages/disadvantages to either, I don't think it being a .NET client should make any difference.

Using document style makes it easier to return more complicated data, and also makes it more flexible to changes in the future. Using RPC allows JAX-RPC to simplify the coding removing the need to parse XML.
 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Micheal,

Any thoughts on the following design question?

I am designing serivce class ( EJB Session bean) WSAD SOAP env.
I have 17 invokable methods in this service class, is it ok to have as
many method in one service class? What is a general rule about # of methods
in one serivce endpoint on which a WSDL is based?

Thanks
E
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I saw that question posted in another thread and thought "I have no idea", but thinking about it I suppose its like asking how many methods should there be in a class - it just depends ....
If all the methods logically belong together then I would say keep them together.
 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If they donot belong together and we are looking at more than one endpoint and hence more than one wsdl? How do my service method invoke each other
if they have to interact ( lets say Order service and Customer service RUNNING ON THE SAME APPLICATION SERVER for simplicity)?

Thanks
E
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to correct something I said earlier - I've found that you can use JAX-RPC with document style - just a setting on the generator of the stub classes (wscompile.bat -f ocumentliteral on Sun - but probably varies for different app servers). In fact since the Basic Profile 1.0 (not sure about later ones) specifies that only document literal or rpc literal styles are valid (i.e. encoded either document or literal is not valid) then the default setting of rpc encoded for wscompile should probably be overridden with document literal or rpc literal unless theres a good reason not to.

If you're generating a Webservice from a Java interface I think theres probably not any difference between document and RPC, from a simple experiment I've done the SOAP messages seem to be the same. - Feel free to correct me if I'm still wrong

Not sure about your last question - not sure if I understand it and don't think its really related to this thread. Perhaps try rephrasing it and starting a new thread ?
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic