Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 44399 invoked by uid 500); 5 Feb 2003 21:16:11 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 44339 invoked from network); 5 Feb 2003 21:16:11 -0000 Message-ID: <01b301c2cd5c$5bfc6c70$1219570f@ranier> From: "Steve Loughran" To: References: Subject: Re: Interoperability between Axis 1.1 Beta and Microsoft .NET Framework 1.0 Date: Wed, 5 Feb 2003 13:20:05 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-MailScanner: Found to be clean X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Axis1.1 handles unsigned stuff too, though not as well as one would like. There is no standard in the rest of the JAX-RPC world for the unsigned types, so its more of a barrier to other java callers than axis/.net interop these days. I'd flag date as trouble as .NET always assumes its time_t equivalent is in the current tz when serialising, and ignores the tz info when deserialising. Axis does use the timezone info in the message, and can introduce an error of +-24 hours in the received value. Sending time as a long is more reliable. Finally, .NET 1.0 does not support attachments; .NET WSE adds DIME support only ----- Original Message ----- From: "Kellogg, Richard" To: Sent: Wednesday, February 05, 2003 12:30 Subject: Interoperability between Axis 1.1 Beta and Microsoft .NET Framework 1.0 Gang could you review the following and correct any errors I might have made? When completed I would like this sort of information included in the Axis distribution. Many thanks to Sam Ruby and Steve Loughran. Thanks, Rick Kellogg Interoperability Notes on Apache Axis 1.1 Beta and Microsoft .NET Framework 1.0 FAQ Last Updated: Feb-05-2003 Author: Rick Kellogg (rkellogg@micros.com) Q: What datatypes can be safely used between Java and the Microsoft .NET 1.0 Framework? A: The following simple Java datatypes can be used: String, boolean, byte, short, int, long, float, double and java.util.Calendar. You can also create arrays of any of the above. Standard Sun JavaBeans (http://java.sun.com/products/javabeans) and arrays of JavaBeans are supported as well. Q: Can the standard Java primitive wrappers like java.lang.Integer or java.lang.Double be used? A: Not directly. Microsoft C# does not have an equivalent language feature. You could work around this by using the C# object datatype. Q: What datatypes or design patterns should I avoid when seeking maximum interoperability? A: You should avoid the following constructs: * Standard Java Collection classes. * Do not use unsigned numeric types in .NET languages. Java does not directly support this feature. * Typesafe enumerations. Use static final variables within Java instead. * Multi-dimensional and jagged arrays * The Java char datatype is not supported because of an omission in XML Schema. * Avoid using the same method name multiple times with varying parameters on a web service. Q: Can you provide a recommendation of how to transport a java.util.Map to C#? A: The easiest solution is to implement a typed array with a JavaBean. public class MapEntryVO { private Object key; private Object value; public MapEntryVO() { } public MapEntryVO(String key, Object value) { this.key = key; this.value = value; } public Object getKey() { return key; } public void setKey(Object value) { key = value; } public Object getValue() { return value; } public void setValue(Object value) { this.value = value; } } ------------------------------------------------ import java.util.*; public class WebServicesUtils { public static MapEntryVO[] convertMapToMapEntryVO(Map conv) { MapEntryVO[] result = new MapEntryVO[conv.size()]; int i = 0; Iterator iter = conv.entrySet().iterator(); while (iter.hasNext()) { Map.Entry item = (Map.Entry) iter.next(); result[i++] = new MapEntryVO(item.getKey(),item.getValue()); } return result; } } ------------------------------------------------ // Example WebService public class TestService { public MapEntryVO[] testMethod() { java.util.Map value = new java.util.HashMap(); value.put("Key 1","Value 1"); value.put("Key 2","Value 2"); return WebServicesUtils.convertMapToMapEntryVO(value); } }