Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
2
Question by Nosfsos · Mar 04, 2016 at 01:15 PM · c#webservice

Unity3D freezes when running a project with webservices for the second time

This is a strange one and I've been trying and searching for a solution for days now.

I have created a simple webservice that queries a local MYSQL database and returns the result for the client. When I use it on a browser it works flawlessly. I created a c# script using wsdl to consume this service inside Unity 3D. The first time I run the game in the Editor it works fine but the second time I try to run it the Editor freezes for the timeout period and then it returns a WebException: Request timed out exception.

I tried creating the wsdl file using mono 4, mono 2 and .NET 4. I tried using the .cs file and creating a dll with dmcs. I tried disposing the proxy class after using it, I try invoking it inside a using block.

At this time I asked a colleague of mine to try the code and in her computer it works every time! I tried on my laptop (windows 10) and had the same result as in my desktop (also windows 10). My colleague was using Windows 8.1, so I booted my desktop with windows 8.1 and reinstalled every relevant software (wamp, VS2015, Unity3D and VSTools) also without any luck. I tried rebuild the source in Visual studio, clean solution, erase Unity 3D cache. I tried a remote server instead using wamp for the mysql database. I also hosted the webservice online instead of locally with IIS 10 express.

For the webservice I created and empty web application in VS2015, then added the data structures I needed and installed MySQL Connector to query the database. For the Unity3D project I used the wsdl proxy class as mentioned before. .NET comparability is set to 2.0 (no subset). Systems.Web and Systems.Web.Services are located in the Plugins folder in the project.

I have no more ideas of what I can do to make this work. Any suggestion would be appreciated. The strangest thing to me is that this thing works on my colleague computer! I can't understand why! We use the same antivirus, firewall, OS, VS version, Unity3d version, MySQL Connector, mono, everything!

EDIT: complete exception:

 WebException: The request timed out
 System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
 System.Net.HttpWebRequest.GetResponse ()
 System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (System.Net.WebRequest request)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by BDF55555 · Jun 06, 2016 at 03:07 PM

I have exactly the same problem! did you fix it?

Comment
Add comment · Show 1 · 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
avatar image Nosfsos · Jun 06, 2016 at 09:20 PM 0
Share

Unfortunatly no, I changed the project in order not to use websockets for the moment so I can keep developing it.

I made the Host query the database ins$$anonymous$$d of using websockets. It's not as safe as I would like but at least works for now.

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Does anyone have any good resources/reading for implementing a web service layer between the client and database? 1 Answer

consume a php webservice in Unity3D C# 2 Answers

how to connect WEBRTC in unity ? 2 Answers

How to make Input Field with middle text align? 2 Answers

Object cant be found in new scene 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