Java Reference
In-Depth Information
Interoperability Best Practices
Problem
It's easy enough to get web services to interoperate between different platforms such as .NET
and Java when the messages are straightforward, but you want to know the general best prac-
tices for interoperability.
Solution
The following list describes a few interoperability best practices that should help you steer
clear of the basic issues developers can run into:
▪ Use document/literal wrapped. This is the default on both the .NET and Java platforms.
.NET clients can have the services appear to be RPC style when they invoke .NET ser-
vices. This is conceptually similar to how WebLogic allows you to set a remote EJB to
appear local to clients in the same JVM.
If you are writing a .NET web service, you can use the SoapRpcService attribute to in-
dicate whether you want to use SOAPAction (the default) or the first child of the SOAP
body element. You can manipulate this as shown here:
[SoapRpcService(
RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
[WebService(...
▪ Use MTOM instead of DIME (Direct Internet Message Encapsulation) for attachments.
DIME is considered deprecated. It was an efficient mechanism for handling MIME attach-
ments by reading the message headers to determine attached file lengths. This allowed it
to forego scanning the entire file, so it was able to work quickly. However, this also meant
that it didn't have a sufficient understanding of the attachments to provide an infoset mod-
el for the message and the attachment. Without an XML infoset, there are no namespace
constraints, and well-formedness can't be determined.
In .NET 3.0 and higher, you can set the following value in your web.configfile (it's equi-
valent to the web.xmlfile) to ensure the use of MTOM on all inbound and outbound mes-
sages:
<microsoft.web.services3>
<messaging>
<mtom serverMode="always" />
Search WWH ::




Custom Search