O'Reilly's 'Java and SOAP' Offers Troubleshooting Tips

This latest volume on Java and web services shows Java developers how best to use SOAP envelops to wrap their code.

Tags: Developers, SOAP, Java, Web Services, Englander, XML-RPC, SOAP Envelops,

O'Reilly has released the first edition of Java and SOAP. It is a nuts-and-bolts look at what Java developers will need to know in order to take advantage of the Simple Object Access Protocol when building applications that tie together databases or messaging functions.

Integration Developer News caught up with Java and SOAP author Robert Englander, to get his view of how developers can best use SOAP. OET also has access to a sample chapter and sample codesets.

Englander, is a principal with MindStream Software, a corporate software developing firm in Hauppauge, New York. He says that developers considering web services projects will need to take a closer interest in transport technologies (such as SOAP and XML-RPC) in their day-to-day programming -- simply because these are new technologies-- and glitches can occur. On that point, Java and SOAP also shows developers how to troubleshoot -- and fix -- open SOAP communications between their Java codesets and other applications and databases written in legacy or ASP/.NET.

Ignore SOAP, XML-RPC at Your Risk
The book Java and SOAP gives developers insights into how SOAP envelops are formed using a variety of techniques. Englander is clear in his view that Java developers who ignore SOAP and XML-RPC do so at some risk.

"I think at this stage of the game, it's critical that developers understand what's happening 'on the wire,'" Englander said. "SOAP, web services, and related technologies are evolving rapidly, and interoperability always suffers at these early stages. So, for this reason I wanted to give the reader a good understanding of the content of the SOAP envelopes that are transmitted. That way when things go wrong -- and they will - developers will be comfortable snooping at the envelope and will have a decent chance of determining what is causing the problem."

This sample chapter provides Java developers with a walk-through example of how to create Java classes that will speak through SOAP to a variety of clients and servers.

Is XML-RPC an Option?
So, might XML-RPC be an attractive alternative to SOAP for Java developers anxious to get started with web services? Englander is not convinced of that. "XML-RPC is certainly a useful mechanism for invoking RPC style services. The biggest issues for me are that SOAP offers more than just RPC invocations, and that SOAP is gaining widespread acceptance in the industry as the underlying protocol of web services," he said.

To offer developers further insight on the question of XML-RPC vs. SOAP, Englander suggests they ask themselves the following two questions:
  • Will your project clearly never go outside the bounds of RPC style invocations?
  • Are you sure the systems you are developing will have no need to interoperate with the larger world of web services?
  • If the answer to both these questions is "Yes," then Englander says, "XML-RPC is as good a choice as any." But, if the answer is "Maybe" or "No," then SOAP should be considered because it keeps many more options open.

    SOAP Keeps Options Open
    This issue keeping a developers' options open -- and avoiding being locked-in -- is an important theme in Englander's book.

    "SOAP (and web services) is not bound to a particular programming language or operating environment. Actually, I think it's important that developers realize right from the start that the world of web services is not planted firmly in any particular software development language," Englander said. "Java is a natural because of the high level of XML support available. However, enterprise developers are sure to encounter .NET and others when working on web services architectures. Understanding the major players like .NET is important, even if you don't anticipate ever developing in those environments."

    Just how simple the jump can be from enterprise development to web services with SOAP can be illustrated by Java and SOAP's Chapter 5 -- Working with Complex Data Types. Here, Englander provides developers with insights into how SOAP envelops are constructed and how they enable the sharing of data across multiple platforms -- by creating services with method parameters and return values that are arrays and? Java beans. Englander has also included this link to several code samples he has put together (in Zip format) from his home website at Mindstream. You can download these codesets at http://www.mindstrm.com/soap.htm .