Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. Dev: So it’s simple?
  2.  
  3. SG: Simple as Sunday, my friend.
  4.  
  5. Dev: Okay, lay it on me.
  6.  
  7. SG: Well, just like it says in the name, SOAP is used for accessing remote objects.
  8.  
  9. Dev: Like CORBA?
  10.  
  11. SG: Exactly like CORBA, only simpler. Instead of some complex transport protocol that no one will let traverse a firewall, we use HTTP. And instead of some binary message format we use XML.
  12.  
  13. Dev: I’m intrigued. Show me how it works.
  14.  
  15. SG: Sure thing. First there’s the SOAP envelope. It’s pretty simple. It’s just an XML document consisting of a header and a body. And in the body you make your RPC call.
  16.  
  17. Dev: So this is all about RPCs?
  18.  
  19. SG: Absolutely. As I was saying, you make your RPC call by putting the method name and its arguments in the body. The method name is the outermost element and each sub-element is a parameter. And all the parameters can be typed as specified right here in Section 5 of the specification.
  20.  
  21. Dev: (reads Section 5) Okay, that’s not too bad.
  22.  
  23. SG: Now, when your service is deployed, you specify the endpoint.
  24.  
  25. Dev: Endpoint?
  26.  
  27. SG: Endpoint, the address of the service. You POST your SOAP envelope to the endpoint’s URL.
  28.  
  29. Dev: What happens if I GET the endpoint’s URL?
  30.  
  31. SG: Don’t know. Using GET is undefined.
  32.  
  33. Dev: Hrrm. And what happens if I move the service to a different endpoint? Do I get a 301 back?
  34.  
  35. SG: No. SOAP doesn’t really use HTTP response codes.
  36.  
  37. Dev: So, when you said SOAP uses HTTP, what you meant to say is SOAP tunnels over HTTP.
  38.  
  39. SG: Well, ‘tunnel’ is such an ugly word. We prefer to say SOAP is transport agnostic.
  40.  
  41. Dev: But HTTP isn’t a transport, it’s an application protocol. Anyway, what other “transports” does SOAP support?
  42.  
  43. SG: Well, officially none. But you can potentially support any of ‘em. And there’s lots of platforms that support JMS, and FTP, and SMTP.
  44.  
  45. Dev: Does anyone actually use these other transports?
  46.  
  47. SG: Uhm, no. But the point is you can.
  48.  
  49. Dev: Fine. How ’bout this SOAPAction HTTP header, what’s that for?
  50.  
  51. SG: To be honest, no one’s really sure.
  52.  
  53. Dev: And these ‘actor’ and ‘mustUnderstand’ attributes, does anyone use those?
  54.  
  55. SG: No. Not really. Just ignore those.
  56.  
  57. Dev: All right, let me give it a shot.
  58.  
  59. (time passes)
  60.  
  61. Dev: Well, I could mostly make things work, but only if I stick with one SOAP stack. Also, I can’t say I like the idea of remote procedure calls and serializing objects.
  62.  
  63. SG: Remote procedure calls! Serialized objects! Where did you get the impression that SOAP was about RPCs? SOAP is all about document-based message passing, my friend.
  64.  
  65. Dev: But you just said —
  66.  
  67. SG: Forget what I said. From here on in we pass around coarse-grained messages — you like that term, ‘coarse-grained?’ Messages that conform to an XML Schema. We call the new style Document/Literal and the old style RPC/Encoded.
  68.  
  69. Dev: XML Schema?
  70.  
  71. SG: Oh, it’s all the rage. Next big thing. Take a look.
  72.  
  73. Dev: (Reads XML Schema spec). Saints preserve us! Alexander the Great couldn’t unravel that.
  74.  
  75. SG: Don’t worry about it. Your tools will create the schema for you. Really, its all about the tooling.
  76.  
  77. Dev: How are the tools gonna do that?
  78.  
  79. SG: Well, they will reflect on your code (if possible) and autogenerate a compliant schema.
  80.  
  81. Dev: Reflect on my code? I thought it was all about documents, not serialized objects.
  82.  
  83. SG: Didn’t you hear me? It’s all about the tools. Anyway, we can’t expect you to write XML Schema and WSDL by hand. Besides, its just plumbing. You don’t need to see it.
  84.  
  85. Dev: Whoa, back up. What was that word? Wizzdle?
  86.  
  87. SG: Oh, haven’t I mentioned WSDL? W-S-D-L. Web Services Description Language. It’s how you specify the data types, parameter lists, operation names, transport bindings, and the endpoint URI, so that client developers can access your service. Check it out.
  88.  
  89. Dev: (Reads WSDL spec). I trust that the guys who wrote this have been shot. It’s not even internally consistent.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement