Error invoking webservice from .net client

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have a gSOAP based server running on linux that I am trying to utilize from a .net based client application (C#). Everything seems to work fine when we are invoking methods with simple parameter types. Problems seem to arise when I try to invoke a method that contains a complex parameter containing an array. The client application generates an System.NullReferenceException in system.web.services.dll

To make sure the client application was correct, I implemented my own webservice using ASP.net and added a method with a parameter identical to the one on the gSOAP servic
and it worked just fine. So next I started to compare the WSDL generated by the two to see if that is where the problem lies and sure enough the WSDL where the parameter is defined is different. However, I am pretty new to all this technology so I don't know if gSOAP is actually generating invalid WSDL in this case or whether it is generating valid WSDL that simply can't be handled by '.net'. The two snippets from the WSDL files are shown below

In my WebServic

class TestPara

int[] IntArray


mapped to the following in the generated WSD

<s:complexType name="TestParam"><s:sequence><s:element minOccurs="0" maxOccurs="1" name="IntArray" type="s0:ArrayOfInt" /></s:sequence></s:complexType><s:complexType name="ArrayOfInt"><s:sequence><s:element minOccurs="0" maxOccurs="unbounded" name="int" type="s:int" /></s:sequence></s:complexType

in gSOAP the following WSDL was generated

<complexType name="CaseIndexList"><sequence><element name="caseIndexList" type="xsd:int" minOccurs="1" maxOccurs="unbounded"/></sequence></complexType

Any comments, suggestions welcomed

Has anyone else tried using a gSOAP server from a .net client with any success using complex parameters

Thanks

Terry
 
i also ran into the same problem using gsoap. It only occurs with complex types, strangely enough when i changed the occurs to 1-1 in the wsdl file and then changed my c# code to pass a single element, the gsoap server accepted it without any changes on the gsoap side. still that restricted me to only passing a single element.

I then tried grabbing the latest version of gsoap but had some errors generating a c# file from my gsoap generated wsdl. If anyone is successfully using complex types with gsoap and .net clients it would definitely help me if you could post what version of gsoap and .net wsdl stub generator you are using.

on a related note, a java client using axis soap has no problem with the complex type making the exat same call against the gsoap server using the gsoap generated wsdl, so that kind of shifts the focus to the c# .net client.

Tim
 
i also ran into the same problem using gsoap. It only occurs with complex types, strangely enough when i changed the occurs to 1-1 in the wsdl file and then changed my c# code to pass a single element, the gsoap server accepted it without any changes on the gsoap side. still that restricted me to only passing a single element.

I then tried grabbing the latest version of gsoap but had some errors generating a c# file from my gsoap generated wsdl. If anyone is successfully using complex types with gsoap and .net clients it would definitely help me if you could post what version of gsoap and .net wsdl stub generator you are using.

on a related note, a java client using axis soap has no problem with the complex type making the exat same call against the gsoap server using the gsoap generated wsdl, so that kind of shifts the focus to the c# .net client.

Tim
 
Back
Top