In what cases do I use a low level API and in what cases do I use a high level API?
Unless you're into complex coding for kicks, generally you use a high-level API whenever possible, and you only use a low-level API when you can't do what you want to do with the high-level API. A high-level API works with a WSDL description and generates all the code necessary to deal with SOAP. A high-level API looks and feels like RMI or COM. It takes the WSDL description and generates a client stub (or an interface and dynamic proxy). You include the stub in your client and you invoke operations on it. The stub code then does all the work of mapping your invocation (method name and parameters) into a SOAP message and sending it to the service.
If you use a low-level API, you need to construct the SOAP envelope and put the payload into it yourself (meaning that you have to work directly with XML). Why would you want to do something like this? Well, perhaps you don't have a WSDL file. Or perhpas you didn't get the WSDL file until runtime, so you couldn't generate the stub. Or perhaps your application is working directly with XML data (rather than Java or C# objects). Or perhaps you want to add a header element to the message, but your SOAP runtime doesn't give you the ability to create headers automatically. Most SOAP implementations now let you intercept the automatic high-level processing to insert/process headers, etc, so you generally don't need to resort to low-level APIs very often.
Dig Deeper on Topics Archive
Related Q&A from Anne Thomas Manes
Anne Thomas Manes explains the differences between open source clients and open source implementations. Continue Reading
Anne Thomas Manes discusses the best way to go about creating an enterprise data dictionary and why the systems works well. Continue Reading
Anne Thomas Manes explains the difference between 'hard' real time and 'live' real time systems. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.