O'Reilly logo

Java and SOAP by Robert Englander

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.5. Accessing .NET Services

Although it's not based on Java, there's no way to avoid a discussion of Microsoft's .NET technology. If you're interacting with web services, you'll certainly run into .NET more than once. To show how to achieve interoperability between .NET and web services written in Java, I've written a .NET web service using the C# language and published it on the Internet at http://mindstrm.com:8199/CorpDataService/Proxy.asmx.[7] For those of you working with .NET, it's necessary to specify that your service style is RPC, since that is not the .NET default service style. To do so, use the [SoapRpcService( )] declaration in your C# code. My .NET service acts as a proxy to the urn:CorpDataServices service running at http://mindstrm.com:8004/glue/urn:CorpDataServices. Figure 9-3 depicts the relationships involved.

[7] The code for the service is located at http://www.mindstrm.com/soap.htm.

Figure 9-3. Interactions between a client, a proxy, and a service

The Proxy service has a getHeadlines method as well as a getQuote method, just like the urn:CorpDataServices service. Each method takes a single string parameter containing a stock symbol. getHeadlines returns an array of strings, and getQuote returns a custom quote data type. You can find information about .NET services simply by navigating to their URL. So enter the URL http://mindstrm.com:8199/CorpDataService/Proxy.asmx ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required