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

Calling a web service from Unity

Discussion in 'Editor & General Support' started by rejwan1, Nov 25, 2012.

  1. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    Hey, we are making a small arcade game that connects to our server's web service to get and store scoring and various other stuff related to the game.

    Using this tutorial:
    http://randomrnd.com/2011/08/21/webservices-in-unity/

    Works 100% fine when building to Android - however, when we try to build to Flash/Unity Webplayer I get one of the following errors.

    WebPlayer:
    ArgumentException: The Assembly System.Drawing is referenced by System.Web. But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/AssemblyHelper.cs:74)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/AssemblyHelper.cs:77)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/AssemblyHelper.cs:77)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/AssemblyHelper.cs:109)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    Flash:
    Usage of a type or method not supported by Unity Flash.
    * Details: Instantiation of unsupported type System.Xml.XmlDocument
    * Source: debugging symbols unavailable, IL offset 0x0000 at line : 0
    Usage of a type or method not supported by Unity Flash.
    * Details: Invokes an unsupported method System.Void System.Xml.XmlDocument::LoadXml(System.String) on type System.Xml.XmlDocument
    * Source: debugging symbols unavailable, IL offset 0x001b at line : 0
    Usage of a type or method not supported by Unity Flash.
    * Details: Invokes an unsupported method System.Void System.Runtime.Serialization.Formatters.Binary.BinaryFormatter::Serialize(System.IO.Stream,System.Object) on type System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    * Source: debugging symbols unavailable, IL offset 0x0020 at line : 0
    Usage of a type or method not supported by Unity Flash.
    * Details: Invokes an unsupported method System.IO.FileStream System.IO.File::Open(System.String,System.IO.FileMode) on type System.IO.File
    * Source: debugging symbols unavailable, IL offset 0x0011 at line : 0
    Usage of a type or method not supported by Unity Flash.
    * Details: Instantiation of unsupported type System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    * Source: debugging symbols unavailable, IL offset 0x0029 at line : 0

    And in the Flash build there are A LOT more errors...

    So basically my question is this - how can I access webservices using Flash/Web player, and will this tutorial work for iOS as well as for Android?

    Thanks
     
  2. KraToSo

    KraToSo

    Joined:
    Feb 27, 2013
    Posts:
    3
    Hey rejwan,

    Did you find an alternative for this problem?
     
  3. Danielpunct

    Danielpunct

    Joined:
    May 9, 2013
    Posts:
    16
    Hey,
    Any updates on this issue? I have the exact same problem now

    Thx