• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by dotSnipe · Jan 05, 2013 at 02:22 AM · iossoap

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.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mattsson · Mar 08, 2013 at 02:42 PM 0
Share

Hah, I have this exact problem as well, did you find a solution?

avatar image dotSnipe · Mar 09, 2013 at 05:09 PM 0
Share

I will hopefully find the time to post a more complete description, but I ended up doing the following :

Took the Cs. file of the WSDL and took out every System.X$$anonymous$$L reference and JIT methods. Stripped down everything to just the classes.

Then I created TCP communication script and a Soap script. The Soap script creates the POST structure and via the TCP I send it to the server. I parce the reply and instantiate the according classes from the stripped WSLD.

I needed the TCP (and not using WWW or other HTTPRequest functionality) because I needed the comm to function in a thread.

Hope this helps someone as I have search a lot until I ended up doing this.

Note : This process might be easier for other platform, but I needed this to work on iOS, thus the complexity.

Best of luck.

avatar image mattsson · Mar 11, 2013 at 08:24 AM 0
Share

Thanks. That sounds rather complicated for my skill level. I did solve it, however, by implementing the SOAP service in Objective-C using Google's ObjC2WSDL app, and then I communicated between Unity and Xcode using an observer on PlayerPrefs variables and mono_runtime_invoke() in Xcode to respond to requests.

avatar image Vishal_ARC · Jul 08, 2015 at 06:56 AM 0
Share

will you please upload source code with example..

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Arshia001 · Apr 10, 2016 at 07:50 PM

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...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Soap multiplatform 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

iOS app is much larger than Android app 1 Answer

iOS build size log output. What do the categories mean? 1 Answer

Should I make custom ad targeting with Admob? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges