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 Sagar Pidaparthi <Sa...@chordiant.com> on 2004/12/15 23:47:01 UTC

RE: Inter operability with c#; complex object array insideanother container

Thanks Andy.   I have ( I believe) found the bug,    There is an additional method in  this class which overloads a getter.   
 
 
    public chordiant.net.biz.ts.wbxml.wbstatus.v1x1._WBStatus getWBStatus(int i) {
        return WBStatus[i];
    }
 
 
The deserializer fails due to this.  I had three such classes and I removed these offending methods from all the three and the application does not choke.  ( Strange!)   I have to see if it is really working by inspecting the arrays.
 
Thanks once again for your response.
 
regards 
 
Sagar

________________________________

From: ANDREW MICONE [mailto:AMICONE@DEQ.IDAHO.GOV]
Sent: Wed 12/15/2004 2:33 PM
To: axis-user@ws.apache.org
Subject: Re: Inter operability with c#; complex object array insideanother container



To the best of my knowledge, arrays of complex types can be passed between J2EE and .NET implementations of SOAP as long as the complex type consists completely of simple primitives (i.e. xsd primitives). I have that woring in production now.

J2EE implementations can pass arrays of complex types consisting of complex types between each other, but .NET chokes on them. There's a tech note at Microsoft to this effect, but I don't have the reference handy. I believe the problem is related to SOAP encodings .NET cannot correctly interpret. -- Andy

>>> Sagar.Pidaparthi@chordiant.com 12/15/04 03:22PM >>>
hi,

I have a c# client running against an RPC axis service.  I can send and return String, String[], Complex object, Complex object array. 

But, I fail when I put a complex object array inside another container.  Did anybody else have the sam problem?


This works fine for a java client.

How do I get around this?

regards

sagar

PS:

The offending class


package chordiant.net.biz.ts.wbxml.wbstatus.v1x1;
public class _WBStatusList  implements java.io.Serializable {
    private chordiant.net.biz.ts.wbxml.wbstatus.v1x1._WBStatus[] WBStatus;
    public _WBStatusList() {
    }
    public chordiant.net.biz.ts.wbxml.wbstatus.v1x1._WBStatus[] getWBStatus() {
        return WBStatus;
    }
    public void setWBStatus(chordiant.net.biz.ts.wbxml.wbstatus.v1x1._WBStatus[] WBStatus) {
        this.WBStatus = WBStatus;
    }
    public chordiant.net.biz.ts.wbxml.wbstatus.v1x1._WBStatus getWBStatus(int i) {
        return WBStatus[i];
    }
    public void setWBStatus(int i, chordiant.net.biz.ts.wbxml.wbstatus.v1x1._WBStatus value) {
        this.WBStatus[i] = value;
    }

}




E:\MicrosoftDOTNETClient>Tester
entered the program
Instantiated wrapper services
callSearchByAccountDOC
_________________________________Returning a String  ____________________________________
Returned a String Test String
_________________________________Completed Returning a String  __________________________
_________________________________Returning a String Array _______________________________
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
Returned String Test String
_________________________________Completed Returning a String Array _______________________________
_________________________________ Returning a Complex Object ___________________
ACTOR 1000
Reason 1000
_________________________________Completed Returning a Complex Object ___________________
_________________________________Returning a Complex Object Array _______________________
ACTOR 10000
Reason 10000
ACTOR 10001
Reason 10001
ACTOR 10002
Reason 10002
ACTOR 10003
Reason 10003
ACTOR 10004
Reason 10004
_________________________________Completed Returning a Complex Object Array ______________
_________________________________Returning a Complex Object Array wrapped in a List Object
Unhandled Exception: System.InvalidOperationException: There is an error in XML document (54, 4). ---> System.InvalidCastException: Cannot assign object of type _WBStatus to an object of type _WBStatus[].
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.fixup_Read1__WBStatusList(Object objFixup)
   at System.Xml.Serialization.XmlSerializationReader.DoFixups()
   at System.Xml.Serialization.XmlSerializationReader.ReadReferencedElements()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read34_wbListReturnResponse()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at CustomerSearchPort_V10WrapperService.wbListReturn()
   at SvcEater.Main(String[] args)
E:\MicrosoftDOTNETClient>