Simple Object Access Protocol

Using C# and SOAP
Using VB6 and SOAP
Using Perl and SOAP
Using Java and SOAP

SOAP allows for RPC-like invocations on objects over the web using HTTP. Although SOAP is not limited to HTTP (you can use SMTP or any other protocol you like), HTTP is the most common since HTTP and the Web are synonymous. Oddly enough, SOAP does not require objects to work. The protocol simply states that a call must be sent in an XML envelope and the reply must be returned as an XML envelope. So you could use XSLT on your server to enable SOAP, although you probably wont.

SOAP was architected by IBM, Microsoft, Lotus, UserLand, and DevelopMentor and supported by IONA, HP, Ariba, Compaq, and Commerce One. You can find SOAP 1.1 on the W3C as a Note and SOAP 1.2 as a Working Draft.

SOAP is not the only RPC-like XML protocol. Others include XML-RPC, WDDX, Wf-XML, and XMI. BizTalk and ebXML are protocols that use SOAP but include business process and packaging. SOAP is the invocation of a method published as a Web service. But the protocols used to locate such services are also XML based. Two XML protocols used for lookup and discovery are UDDI and DISCO. Finally XML is also used to describe the interface of a web service in WSDL, WIDL, and NASSL. The W3C has a chart comparing XML Protocols including all of those mentioned above.

The current trend is to use the following XML applications with SOAP.

  • SOAP - to send the packet or invoke the method and receive the result. This is similar to an HTTP POST call when you submit an HTML form.
  • WSDL - to define the method interface, so callers know what to send and the format and data types allowed. This is similar to an interface in VB, C++, Java, CORBA, COM, or C#.
  • UDDI - to advertise web services or look up services, similar to the yellow pages.

Using C# and Microsoft .NET to Build a Web Service

Microsoft's new .NET platform is designed around components and web services. In C# or VB.NET, for example, all you need to do is write an ASP.NET page that includes a class that extends the System.Web.Services.WebService class and mark the methods that you want to publish on the internet with an attribute: [WebMethod] in C#, <WebMethod> in VB.NET. The .NET Framework does the rest. At that point your method is exposed as a web service over the internet for SOAP calls via HTTP. The WSDL (Web Service Description Language) is created on the fly. All the interested consumer of your service needs to do is add ?WSDL to the end of the URL to your ASP.NET page. With the WSDL (pronounced wizdle), the consumer can build an application in any language on any platform using HTTP (the web) and XML (the serialization format) and now they can access the service. How do you bill your consumer, that part has not been resolved yet.

Using Visual Basic 6.0 to Build a Web Service

Microsoft is not the only web service development tool vendor, and you don't need .NET either. Microsoft has a SOAP Toolkit with an sample application that uses Visual Basic 6.0, ActiveX, and VBScript to publish a web service.

Using Perl to Build a Web Service

ActiveState's Perl comes with Web service modules called SOAP::Transport::HTTP, SOAP::Lite, and XML::Parser. Read more about ActiveState's Web services initiative and how Perl and SOAP can be used to create or consume Web services.

Using Java to Build a Web Service

If you are a Java developer, IBM created SOAP4J which has now evolved into Apache SOAP. Sun Microsystems has released an "early-access" implementation of SOAP called JAXM, Java APIs for XML Messaging. There is a nice white paper published by Sun called Web Services Made Easier which breaks down Sun's Java XML APIs: JAXP, JAXB, JAXM, JAXR, and JAX-RPC. The only one that is production quality is JAXP which is included with J2SE 1.4.

DevelopMentor is currently implementing the SOAP protocol for Perl, Java, and C/C++/COM. Visit www.develop.com/soap to read more about what DevelopMentor is doing with web services and SOAP. You can also more about Web services for B2B and how end users can benefit.