How to successfully consume a WSDL service in Unity3D C# for iOS ?

Hello all,

this entire set up has been driving me crazy for days. I REALLY hope somebody can help.

Idea :
What I want is to consume a wsdl service and communicate to the server. I want to deploy to iOS and Android eventually.

Problem :
I got the wsdl file. I converted it to .cs via the mono wsdl function. So now I have my SOAP class ready. This class is using System.Web && System.Web.Services as well as System.Xml and others. In my Plugins folder I only have the System.Web.dll && System.Web.Services.dll.

Now according to a tutorial here : http://wiki.unity3d.com/index.php?ti...vices_In_Unity I got it to work on my Mac. It act as expected in most cases, but when I Build for iOS target it says :

ArgumentException: The Assembly System.EnterpriseServices is referenced by System.Web.Services. But the dll is not allowed to be included or could not be found.
The above error is with .Net 2.0 subset.

If I change it to .Net 2.0 (no subset) then it build for iOS successfully but then Xcode throws and error that :

Attempting to JIT compile method
The second one happens because Apple does not allow code to be generated, so I suppose it is not an option. This leaves the first option with the subset, but I just can not seem to build that version for iOS.

I tried System.Web files from mono 2.0 && wsdl generated for 2.0 as well as mono 4.0 && wsdl generated for 4.0 ! Did not work for me.

Please help someone.

  1. Did someone actually successfully implemented a wsdl SOAP service in Unity that was deployed to iOS ?
  2. Does someone have any ideas I can try, cause I think I ran out of brain power and ideas.

.Snipe.

I found this question thought google, and since others might end up here as well, I’m going to share my solution to it (discovered though a sizeable amount of lost hair) even though the question is rather old.

Basically, to invoke a service, you need to serialize the inputs. On primitive types this happens without the need for any reflection, but to serialize a complex type you definitely need some form of reflection which is not available on iOS in any form. My solution was to find all functions which accept complex types in the service, and create secondary versions which take the same data, but using primitive types only. So, currently, in my service I have something like:

void SomeFunction(ComplexType data);
void SomeFunction_iOSIsStupid(int data_int, string data_string);

which works just fine. Of course, this solution is only viable if you’re the author of the service, but at least it’s better than nothing…