Don't ask to ask, just ask | |
PerlMonks |
Re^4: start over with SOAP in Perl?by exussum0 (Vicar) |
on Sep 01, 2006 at 16:27 UTC ( [id://570800]=note: print w/replies, xml ) | Need Help?? |
...except when it isn't, such as when document/literal encoded - reasonable description here.You're splitting hairs. :) A function call is simply something to the effect of a receiver getting some information and responding to it. A document/literal encoded message in SOAP is a receiver getting some information, processing it as it sees fit, and responding to it. The differences are semantics. They act the exact same in the general scheme of life, love, and the persuit of beer. Many of the use cases were fantasy - something vendors where / are hoping to sell in the SOA orgy. examples? Im curious.So what's the addressing scheme for? And how did we get to HTTP over SOAP?. Also document / literal style services aren't about calling remote APIs - what you describe is only a subset of SOAP - Encoded / RPC over HTTP.The endpoint url? It's not required. An engine will ask you for an endpoint, some place to deliver a message. I can route soap over smtp/e-mail and process it as an asynchronous queue. Document passing IS a form of rpc in that the receiving side looks at the message and decides what to do w/ it. the only difference between formal rpc and document passing, is in the nomenclature. In the end, you are sending a message, a message as a document or a message in a more common "function call like document" that warrants a response. So why HTTP? Why not? Most people were doing RPC (REST and so forth) over various protocols. HTTP is most popular. Again, SOAP is a format protocol for messages, documents and what not. It's not reliant on networking or anything of that nature. I know where you're coming from but in the end that's the illusion of SOAP - it feels good when everything "just works" like this. But the moment it doesn't, you got a huge stack of code to debug + verbose wire formats (can you do XSD by hand?). And with networks involved, there are a lot of things that can go wrong. And have mercy the moment you need to scale to anything but low volume Intranet / Extranet interfaces...All generalizations are wrong. Sadly, I've done debugging on soap interfaces when something has gone wrong, either a bug in a toolkit, or something jsut didn't feel right. Once you know how, it's easy. Learn soap, learn soap toolkits, and basic soap debugging, and it becomes portable. Sorry, this "illusion" and "bullshit" (from earlier) is subjective. It's got error handling, a trace of the "raw" HTTP conversation and it gives you an instant data structure to examine. It's relatively easy to extend this to support conditional GETs and you're already on your way to preserving bandwidth / scaling.That's nice you can dump the content of an XML feed, but now you need to execute an XML parser over it and examine the XML content. Also, you have to format the url. In a soap-esq ay, I would do something like
We can argue the ins and outs of this ad infinitum but from my perspective, simple always wins.Not arguing who's right, who loses and all that BS. This is computer engineering and software design. Only thing that wins in the end is what works. If you can use REST, great. Awesome. I know many people who use it successfully. I personally prefer SOAP simply because I don't have to worry about XML parsing, recreating an object model and the likes. An annecdotal example: I had to work with salesforce.com, a CRM system once. I needed to pull a user's information, and sync it to a local user's records depending on the situation. I got their quickstart document, explaining the calls and the wsdl. Took the WSDL, generated the code and was up to the debugging point within minutes. The debugging points were things like calling their APIs in a certain order, which ones I should use for efficiency, and various other things like trying to divide by zero due to my own stupidity. Another annecodal example: verisign uses rest. I grabbed their document and started writing code agaist their target url. I reconstructed an object model, by hand, that worked around the data being sent and retrieved. I implemented the communications by hand, parsed the responses by hand and sent out the request, by hand. I was up rather quickly after debugging all the code I wrote. In the end, I ran into little troubles with either. w/ the SOAP implementatoin, I had LESS code to write and was faster to get working because of the standard. Now, I'm not trying to convince you to use SOAP over REST. Use whatever you wish, it's ok. But please, don't spread misinformation if it can be helped :)
In Section
Meditations
|
|