Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

unity and wcf

Discussion in 'Editor & General Support' started by atmuc, Aug 21, 2012.

  1. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i found some solutions but i still have compile SlSvcUtil output. compiler cannot find class definition ChannelBase.

    does anyone use wcf successfully with unity? i consider all platforms. flash, ios etc.
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    I've done some research on this, but haven't yet started my WCF coding. With that said, others have reported that copying the System.ServiceModel.dll and System.Security.dll to your assets/plugin folder, and making sure your application api compatibility settings are set for the full .Net 2.0 runtime (not the "reduced").
     
  3. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i did all. can you write your result here?
     
  4. Acenth

    Acenth

    Joined:
    Aug 14, 2012
    Posts:
    42
    WCF in Mono 2.6 is missing many critical features. I looked into using it in my project and there were too many areas where methods weren't implemented or didnt account for things.

    Even in the latest Mono, there are broken features that have been broken since last Fall.

    I ended up using Protobuf-net with TCPClient/Listener.
     
  5. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i fact i do not need all features of wcf. now it looks like it does not support Transport level security.
     
  6. Acenth

    Acenth

    Joined:
    Aug 14, 2012
    Posts:
    42
    You may not need all features, but it lacks many basic features to even function in a production environment. I spent a good week trying to make it work. WCF was never really designed to be used by non-Windows environment.
     
  7. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    In my last project, I just coded up a utility class and used .Net web services over https. It was a simple matter to hide the serialization using generics. Depending on your needs, this may or may not work for you. Considering the trouble you are having with WCF, maybe it's best to just stick with that route. Worked on the iphone without problems, at least.
     
  8. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i can call wcf 4.0 services for standalone builds. i have problem with ios build.

    UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --aot=full,asmonly,nodebug,static,outfile="Mono.WebBrowser.dll.s" "Mono.WebBrowser.dll"
     
  9. Fehr

    Fehr

    Joined:
    Mar 3, 2011
    Posts:
    23
    Has anyone been able to consume WCF through unity on iOS?

    I'm in atmuc's position now too, trying to deal with the Mono.WebBrowser.dll not compiling. We have invested a lot of time into getting Untiy properly consuming WCF services, we have it running on as a windows and osx standalone, and android, every platform we need but IOS. The engineers designing the server side implementation have no unity experience and have developed a WCF web server despite the primary market for the app being iOS.

    If I cant bind on iOS due to Mono.WebBrowser.dll not compiling, this leaves me between a rock and a hard place, as in order to interact with the web server from iOS I will now need to make WWW calls to aspx over http without any contracts or bindings, yielding for every response from the web server, and not being able to return values from the IEnumerators that wait for the response.

    I've been able to download the source code for Mono.WebBrowser and am currently trying to figure out if it is possible to modify it to run under iOS, but I have very little idea where to start, has anybody been able to find an alternative DLL, or is anyone perhaps aware of a way to get these dll's compiling when building to iOS? As I stated, the WCF binding runs without issue on OSX, so surely it must be possible.

    Thanks in advance for any help anyone is able to provide.
     
  10. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    do not try to use webservices. use web get requests and json responses. you can set a wcf service to response as json if wcf service is yours. or use mvc actions that returns json response. for these purposes use unity's WWW class. do not force limits, use opportunities you have :)