axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McCaslin Orion" <mccaslin_or...@bah.com>
Subject Interoperability Axis with .NET (C#)
Date Tue, 31 Dec 2002 20:31:54 GMT
Hi,

Web Services issue:
----------------------------------------------------------------------------
-------------
Anyone know if it is possible to pass an array of Complex Objects from a
Java-based system to a .Net(C#) system?
----------------------------------------------------------------------------
-------------
I did this successfully with a test client for Java to Java (created Java
custom serializer/deserializer and used typemapping to override default
serializers).

However, On the .Net side...
After I add the Web Reference(auto-generates the invoke functions based on
the service WSDL), I get a ClassCastException when returning a single
complex Object(I can atleast parse through the System.Xml.XmlNode[]).
And, I get the following Exception when trying to return an array of Complex
Objects (Class Object with string members):

THE FUNCTION:
public Data[] getDataObjects() {
	object[] results = this.Invoke("getDataObjects", new object[0]);
      return ((Data[])(results[0]));
}

THE EXCEPTION:
Exception  : System.InvalidOperationException: There is an error in XML
document (5, 5). ---> System.InvalidOperationException: Namespace prefix
'null' is not defined.
   at
System.Xml.Serialization.XmlSerializationReader.ToXmlQualifiedName(String
value)
   at System.Xml.Serialization.XmlSerializationReader.ReadArray()
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g name, String ns, Boolean elementCanBeType, String& fixupReference)
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g name, String ns, String& fixupReference)
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g& fixupReference)
   at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read4_
getDataObjectsResponse()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader)
   at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
   at
WindowsApplication1.WebReference1.ElementServiceService.getDataObjects() in
c:\documents and settings\desktop\tia\c#tdoserdeser\windowsapplication1\web
references\webreference1\reference.cs:line 40
Message    : There is an error in XML document (5, 5).
StackTrace :    at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
   at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)




Mime
View raw message