Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 951 invoked from network); 26 Oct 2007 16:55:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2007 16:55:16 -0000 Received: (qmail 52463 invoked by uid 500); 26 Oct 2007 16:54:54 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 52057 invoked by uid 500); 26 Oct 2007 16:54:52 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 52046 invoked by uid 99); 26 Oct 2007 16:54:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 09:54:52 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rupadhyayula@responsys.com designates 206.173.245.221 as permitted sender) Received: from [206.173.245.221] (HELO mail.responsys.com) (206.173.245.221) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 16:54:53 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C817F0.E1B48EA4" Subject: RE: [Axis2] Problem with C# client accessing a Web Service Date: Fri, 26 Oct 2007 09:54:32 -0700 Message-ID: In-Reply-To: <001801c8178e$03592d70$953310ac@infolabs.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Axis2] Problem with C# client accessing a Web Service Thread-Index: AcgXV9kGMJFOEyuyQyaN6dRV02Fy9wANd2UAABiIMqA= References: <001801c8178e$03592d70$953310ac@infolabs.com> From: "Raghu Upadhyayula" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C817F0.E1B48EA4 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Sudhir, =20 I figured out the problem but don't really know how to solve it. =20 Looks like the wsdl.exe tool I'm using has a bug. It creates a two-dimensional string array if the wsdl has nested elements that contains maxOccurs=3Dunbounded. =20 In my WSDL I have the elements defined as follows. =20 =20 =20 In the service class, this structure is generated as follows., observe that the records field is created as a string[][] instead or Record[] =20 /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] =20 [System.Xml.Serialization.XmlTypeAttribute(Namespace=3D"urn:ws.rsys.com")= ] public partial class RecordData { =20 private string[] fieldNamesField; =20 private string[][] recordsField; =20 /// [System.Xml.Serialization.XmlElementAttribute("fieldNames", IsNullable=3Dtrue)] public string[] fieldNames { get { return this.fieldNamesField; } set { this.fieldNamesField =3D value; } } =20 /// [System.Xml.Serialization.XmlArrayAttribute(IsNullable=3Dtrue)] [System.Xml.Serialization.XmlArrayItemAttribute("fieldValues", typeof(string))] public string[][] records { get { return this.recordsField; } set { this.recordsField =3D value; } } } =20 Thanks Raghu =20 ________________________________ From: Sudhir Sharma [mailto:sudhir.sharma.tr@espireinfo.com]=20 Sent: Thursday, October 25, 2007 10:06 PM To: axis-user@ws.apache.org Subject: RE: [Axis2] Problem with C# client accessing a Web Service =20 Hi Raghu, =20 Can u put your code (java and C#) here so that we can check and compare them to find out the loop holes.=20 =20 Thanks & Best Regards, Sudhir Sharma ________________________________ From: Raghu Upadhyayula [mailto:rupadhyayula@responsys.com]=20 Sent: Friday, October 26, 2007 4:09 AM To: axis-user@ws.apache.org Subject: [Axis2] Problem with C# client accessing a Web Service =20 Hi, =20 I have a webservice developed using Axis2 1.3. I wrote a Java client to access this webservice and everything is working fine. =20 Today I started writing a C# client to access the same webservice. =20 I've used the wsdl.exe tool that comes with Microsoft Visual Studio to generate the client code and wrote my own class to access methods in the web service. =20 Now when I try to run the C# client, I'm getting the below exception. =20 at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() at WSCSharpClient.ResponsysWSService..ctor() at WSCSharpClient.TestResponsysWS.login() at WSCSharpClient.TestResponsysWS.run() Unable to generate a temporary class (result=3D1). error CS0030: Cannot convert type 'string[]' to 'string' error CS0029: Cannot implicitly convert type 'string' to 'string[]' =20 Does anyone have an idea what the problem is or am I missing anything else? =20 Thanks in Advance. Raghu ------_=_NextPart_001_01C817F0.E1B48EA4 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi = Sudhir,

 

      =       I figured out the problem but don’t really know how to solve = it.

      =      

      =       Looks like the wsdl.exe tool I’m using has a bug.  It creates a two-dimensional string array if the wsdl has nested elements that = contains maxOccurs=3Dunbounded.

      =      

      =       In my WSDL I have the elements defined as = follows.

      =      

         &n= bsp;  <complexType = name=3D"RecordData">

         &n= bsp;      <sequence>

         &n= bsp;          <element maxOccurs=3D"unbounded" = name=3D"fieldNames" nillable=3D"true" = type=3D"xsd:string"/>

         &n= bsp;          <element maxOccurs=3D"unbounded" name=3D"records" nillable=3D"true" = type=3D"tns:Record"/>

         &n= bsp;      </sequence>

         &n= bsp;  </complexType>

         &n= bsp; 

         &n= bsp;  <complexType name=3D"Record"><= /font>

         &n= bsp;      <sequence>

         &n= bsp;          <element maxOccurs=3D"unbounded" name=3D"fieldValues" nillable=3D"true" type=3D"xsd:string"/>

         &n= bsp;      </sequence>

         &n= bsp;  </complexType>

      =      

      =       In the service class, this structure is generated as follows., observe that = the records field is created as a string[][] instead or = Record[]

      =      

    = /// <remarks/>

    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]

    = [System.SerializableAttribute()]=

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.ComponentModel.DesignerCategoryAttribute("code")]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace=3D"urn:ws.rsys.com")]<= /o:p>

    = public partial class RecordData = {

       

        private = string[] = fieldNamesField;

       

        private = string[][] = recordsField;

       

        /// <remarks/>

        [System.Xml.Serialization.XmlElementAttribute("fieldNames", = IsNullable=3Dtrue)]

        public string[] = fieldNames {

            get = {

           &= nbsp;    return this.fieldNamesField;

            }

            set = {

           &= nbsp;    this.fieldNamesField =3D value;

            }

        }

       

        /// <remarks/>

        [System.Xml.Serialization.XmlArrayAttribute(IsNullable=3Dtrue)]

        [System.Xml.Serialization.XmlArrayItemAttribute("fieldValues", typeof(string))]

=

        public string[][] records = {

            get = {

           &= nbsp;    return this.recordsField;

            }

            set = {

           &= nbsp;    this.recordsField =3D value;

            }

        }

    = }

 

Thanks

Raghu

 


From: = Sudhir Sharma [mailto:sudhir.sharma.tr@espireinfo.com]
Sent: Thursday, October = 25, 2007 10:06 PM
To: = axis-user@ws.apache.org
Subject: RE: [Axis2] = Problem with C# client accessing a Web Service

 

Hi = Raghu,

 

Can u put your code (java and C#) = here so that we can check and compare them to find out the loop holes. =

 

Thanks & = Best Regards,

Sudhir = Sharma


From: Raghu Upadhyayula [mailto:rupadhyayula@responsys.com]
Sent: Friday, October 26, = 2007 4:09 AM
To: = axis-user@ws.apache.org
Subject: [Axis2] Problem = with C# client accessing a Web Service

 

Hi,

 

         =    I have a webservice developed using Axis2 1.3.  I wrote a Java = client to access this webservice and everything is working = fine.

         =   

         =    Today I started writing a C# client to access the same = webservice.

         =   

         =    I’ve used the wsdl.exe tool that comes with Microsoft Visual Studio to generate the client code and wrote = my own class to access methods in the web service.

         =   

         =    Now when I try to run the C# client, I’m getting the below = exception.

 

   at = System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, = Evidence evidence)

   at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, = XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable = assemblies)

   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, = Type[] types, String defaultNamespace, String location, Evidence = evidence)

   at = System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)

   at System.Web.Services.Protocols.SoapClientType..ctor(Type = type)

   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

   at WSCSharpClient.ResponsysWSService..ctor()

   at WSCSharpClient.TestResponsysWS.login()

   at = WSCSharpClient.TestResponsysWS.run()

Unable to generate a temporary class = (result=3D1).

error CS0030: Cannot convert type 'string[]' = to 'string'

error CS0029: Cannot implicitly convert type 'string' to 'string[]'

 

         =    Does anyone have an idea what the problem is or am I missing anything = else?

 

Thanks in Advance.

Raghu

------_=_NextPart_001_01C817F0.E1B48EA4--