I’m developing an iPhone application with Monotouch and using a ASMX web-service.
The WebReference was added correctly (thanks to .wsdl file) and I started to use my WS reference:
public static string CallWs(string[] arrData_,
List<string[]> lstObject_)
{
WebService webService = new Service ();
webService.CallMethod(arrData_, lstObject_);
}
My web-service has a correct method public void CallMethod(string[] arrData_, List<string[]> lstObject_), the .wsdl file describe it correctly (ArrayOfArrayOfString) but MonoTouch sees it like public void CallMethod(string[] arrData_, string lstObject_).
So, I tried to modify my method to string[][]: same issue
I tried to use NewtonSoft.Json DLL to parse my data but this needs System.Drawing implicitly (that is not present with Monotouch, CoreGraphics replaces it), so it can be found and resolved.
EDIT :
The current solution is editing the Reference file and change the parameter type.
Is there an other solution ? why MonoDevelop does not recognize correctly my web service ?
Collection types such as
IList<string>are not fully supported yet.There are two main problems here:
Creating the client proxy from WSDL.
You can work around this by using
SLSvcUtil.exeon Windows.Message Serialization
This is the more serious problem as it prevents you from talking to the remote service.
I already implemented some of the missing pieces last week, but it’s not complete yet. Dictionary types are still missing and I also need to do some more tests with arrays and more complex types such as arrays of arrays.
Another issue is more cosmetic: there is no difference between
and
in the WSDL (both are
ArrayOfint). Visual Studio lets you configure the collection type (right-click your Service Reference, select “Configure Service Reference”, there’s “Collection Type” in the middle of that dialog) that should be used in the generated client proxy.MonoDevelop doesn’t support that yet and uses arrays (or better: it should use arrays; at the moment, it’s simply crashing. I’ll have a look at that).