Receiving a nillable element from a .NET webservice using Blackberry
I have a .NET webservice sitting on my local IIS. I'm calling 1 method from it, ClientSearch, using a Blackberry. The method is:
[WebMethod]
public List<Client> ClientSearch(string Surname, string Forename, string DOB, string Postcode)
{
List<Client> clients = new List<Client>();
// Populate list
return clients;
}
When I call this from my Blackberry simulator I get the error:
"not nillable element of array type in response is missed".I'm accessing the webservice using stubs generated by the Sun Wireless Toolkit 2.5.2. The wsdl file for the client type contains:
<s:element minOccurs="0" maxO开发者_如何转开发ccurs="unbounded" name="Client" nillable="true" type="tns:Client" />
This is where the nillable comes from but the values are hardcoded in the web method so it should always have a value.
The code i'm using to call the webservice is the same as I use in every BB app to call them so I know that it works.
Service1Soap_Stub stub = new Service1Soap_Stub();
result = stub.clientSearch("", "", "", "");
I'm using Eclipse 3.4.0 (Ganymede) and the Blackberry JDE Plug-in 1.0.0.67 and component pack 4.5.0.
I've seen this on a few different forums but can't find how to solve this issue.
Solved the problem. The issue is that my Client object had some public properties that were never assigned a value too. I thought they would have the default values for their type but that wasn't the case.
精彩评论