Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity3D wsdl SOAP service ( JIT problem)

Discussion in 'Scripting' started by dotSnipe, Jan 5, 2013.

  1. dotSnipe

    dotSnipe

    Joined:
    Nov 9, 2011
    Posts:
    20
    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?title=Webservices_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 :

    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 :

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

    Landern

    Joined:
    Dec 21, 2008
    Posts:
    354
    What is the full error, iOS doesn't use JIT(Just in time), it uses AOT(Ahead of time), so again, what is the full call stack that you are getting?
     
  3. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    My advice - don't use SOAP. KISS
     
  4. dotSnipe

    dotSnipe

    Joined:
    Nov 9, 2011
    Posts:
    20
    @Landern : The error in which case ? The Xcode JIT error or the build to iOS error ?

    @npsf3000 : I should have also clarified. I do not have any control of the web service. I can either use REST or SOAP. REST is very limited comparing to the SOAP service and will not cut it functionality wise. So, I need to use the SOAP one.
     
  5. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Last time I dealt with an arbitrarily complicated web-service that didn't play well with Unity due to libraries/reflection, I simply built a proxy :)

    KISS
     
  6. dotSnipe

    dotSnipe

    Joined:
    Nov 9, 2011
    Posts:
    20
    Hello again to all,

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

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    I believe that the only way Unity guarantees HTTP requests working across platforms is the WWW class.

    So you might want to make a wrapper around this, or use something that already wraps it, like eDriven framework's HttpConnector class.

    I've been using this class all the time, for instance with this WebPlayer demo: http://edrivenunity.com/load-images (check out the demo source, containt the info on using HttpConnector).

    I've been successfully communicating with Drupal CMS on backend using its REST service module; SOAP should not be much harder.
     
  8. dotSnipe

    dotSnipe

    Joined:
    Nov 9, 2011
    Posts:
    20
    @dkozar : Thank you for the example and input.

    Like I mentioned, I took the above mentioned approach because I needed to communicate in a separate Thread.
    As far as I know the WWW class is not available unless used in the main Thread, thus the implementation mentioned.

    If there is some other way, I would be more than glad to hear it. :)
     
  9. reena

    reena

    Joined:
    Apr 15, 2015
    Posts:
    7
    Even i am stuck.
    I have some wsdl file.

    Do in unity SOAP method works?