Re: SOAP in Pike?
"Stephen R. van den Berg" <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Pontus ??stlund wrote: >> What about the parameter interface. Anything in that code worth copying over >> to my new implementation in Pike 8.1? >Do you mean the Param class from the SOAP-helper repo? I can't find any > parameter interface in the old WSDL stuff. But the Param class in SOAP-helper > can handle quite complex parameters, so that one could probably be of use. Ok. I'll quickly flip through that to see if there is anything worth salvaging. I sort-of solved the parameter assignment by simply creating a nested mapping structure which I then overload the = operator on; i.e. the wdsl precreates the nested mapping structure, so there is no need to parse mappings anymore. The function results are simply presented as a nested mapping. >Personally I hope SOAP dies :D >SOAP is awesome if you are programming in Java or C# where there are tools to auto-generate entire API's for you from the WSDL files. But if you don't have that luxury it's just overly verbose and complex. I prefer REST API's with JSON :) Yes, well, as you might have guessed, I stumbled upon a customer that insists on using it, so I either had to make it at least digestible in Pike or (god forbid) access it from PHP or Java. It definitely is not for the faint of heart. Fun fact (perhaps): instead of reading the RFC, I just massaged the wsdl XML I got from the APIs I'm supposed to use till the point where I could actually assign values and get something back. It is surprising how little code one actually needs to parse wsdl into something sensible (mappings). It's sort-of a clean-room implementation of SOAP/wsdl, reverse engineered from on-the-wire XML. -- Stephen.