I just created a web service with Axis 1.1beta for a RPC method that returns an array of JavaBeans.
I installed Office XP WS Toolkit 2.0, http://www.microsoft.com/office/developer/webservices/toolkit.asp, and by just supplying the WSDL generated from above, MS VB generated the correct client stubs without my interference. The only caveat is toolkit is not .NET, and the code is not VB.NET, so the JavaBean array was represented as a "variant" in VB, a type that has been deprecated for VB.NET ;-).
However, since the Office XP toolkit 2.0 uses the same soapclient30.dll as .NET platform, I don't see how .NET wouldn't be able to interop just as easily as the toolkit did.
Gene
McCaslin Orion <[EMAIL PROTECTED]> wrote:
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)