You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by McCaslin Orion <mc...@bah.com> on 2002/12/31 21:31:54 UTC

Interoperability Axis with .NET (C#)

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)




Re: Interoperability Axis with .NET (C#)

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Gene Chuang" <ge...@yahoo.com>
To: <ax...@xml.apache.org>
Sent: Thursday, January 02, 2003 11:05
Subject: Re: Interoperability Axis with .NET (C#)


>
> Sorry about the mis-information.  I was looking at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxpwst2/ht
ml/odc_CmplxTypes.asp
> >Note   In addition to being provided with the Office XP Web Services
Toolkit 2.0, the SOAP 3.0 DLL is also included in the SOAP Toolkit 3.0 along
with a user guide.
> And I assumed that the SOAP Toolkit 3.0 is part of .Net...  I thought the
benefit of using MS platform was conformity across all of their tools?  I
guess that's not even possible in MS land! :-)

ha. MS have AFAIK the following soap impls

MS STK
ATL Server
.NET remoting
.NET ASMX
UPNP (uses soap 0.9; only needs to interop with other UPNP impls)

I'd expect the .net lines to unify; UPNP may use an older version of MSSTK,
perhaps, and ATL server to go away unless is suddenly becomes popular.
Office SOAP uses the MSSTK. So all in, they probably have their own interop
festivals on a regular basis


Re: Interoperability Axis with .NET (C#)

Posted by Gene Chuang <ge...@yahoo.com>.
Sorry about the mis-information.  I was looking at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxpwst2/html/odc_CmplxTypes.asp
>Note   In addition to being provided with the Office XP Web Services Toolkit 2.0, the SOAP 3.0 DLL is also included in the SOAP Toolkit 3.0 along with a user guide.
And I assumed that the SOAP Toolkit 3.0 is part of .Net...  I thought the benefit of using MS platform was conformity across all of their tools?  I guess that's not even possible in MS land! :-)
Gene
Steve Loughran <st...@iseran.com> wrote:
----- Original Message -----
From: "Gene Chuang" 
To: 
Sent: Wednesday, January 01, 2003 19:12
Subject: Re: Interoperability Axis with .NET (C#)


>
> 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.


.net doesnt use soapclient30.dll, which is part of the MS Soap Toolkit; .NEt
has its own implementation(s) of SOAP. So you cant guarantee that just
because the native code toolkit works. the .NET one will

Re: Interoperability Axis with .NET (C#)

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Gene Chuang" <ge...@yahoo.com>
To: <ax...@xml.apache.org>
Sent: Wednesday, January 01, 2003 19:12
Subject: Re: Interoperability Axis with .NET (C#)


>
> 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.


.net doesnt use soapclient30.dll, which is part of the MS Soap Toolkit; .NEt
has its own implementation(s) of SOAP. So you cant guarantee that just
because the native code toolkit works. the .NET one will


Re: Interoperability Axis with .NET (C#)

Posted by Gene Chuang <ge...@yahoo.com>.
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 <mc...@bah.com> 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)