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 /
avatar image
0
Question by billingsleyjon · Aug 31, 2016 at 05:38 AM · c#webinternetwebservice

Accessing A 3rd party webservice from Unity C#

Please take a look at the directions I was given by this 3rd party partner. I have no control what soever over their website. I work for an architecture firm.

I just need to access this from the unity C# code.

right now I'm doing basically this:

 using UnityEngine;
 using System.Collections;
 using System.Net;
 using System.IO;
 
 public class WebServices : MonoBehaviour
 {
 
     string access = "http://zimas.lacity.org/zmaWS/ZIMASDataService.svc/GetZIMASAddress?HseNum=200&StrNm=sp";
     // Use this for initialization
     void Start()
     {
         StartCoroutine(go());
     }
     IEnumerator go()
     {
         WWW wsa = new WWW(access);
         yield return wsa;
         yield return new WaitForSeconds(2.0f);
         print("text... " + wsa.text);
 
     }
 
     void Update() { }
 }
 



alt text

directions.png (63.2 kB)
Comment
Add comment · Show 7
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 billingsleyjon · Aug 30, 2016 at 08:51 PM 0
Share

Also, I should mention that it's returning a bunch of HT$$anonymous$$L code - not something I can use the information is not there.

Or doesn't seem to be.

avatar image billingsleyjon · Aug 30, 2016 at 08:52 PM 0
Share
 text... <!DOCTYPE html PUBLIC "-//W3C//DTD XHT$$anonymous$$L 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
 <title>404 - File or directory not found.</title>
 <style type="text/css">
 <!--
 body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
 fieldset{padding:0 15px 10px 15px;} 
 h1{font-size:2.4em;margin:0;color:#FFF;}
 h2{font-size:1.7em;margin:0;color:#CC0000;} 
 h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
 #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet $$anonymous$$S", Verdana, sans-serif;color:#FFF;
 background-color:#555555;}
 #content{margin:0 0 0 2%;position:relative;}
 .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
 -->
 </style>
 </head>
 <body>
 <div id="header"><h1>Server Error</h1></div>
 <div id="content">
  <div class="content-container"><fieldset>
   <h2>404 - File or directory not found.</h2>
   <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
  </fieldset></div>
 </div>
 </body>
 </html>
 
 UnityEngine.$$anonymous$$onoBehaviour:print(Object)
 <go>c__Iterator9:$$anonymous$$oveNext() (at Assets/WebServices.cs:26)
 
avatar image Bonfire-Boy billingsleyjon · Aug 31, 2016 at 11:45 AM 0
Share

That's a 404, which suggests you might have got the URI wrong. Have you verified your access string by copying it into a browser?

I get the 404 page when I do that. So it looks to me like your code is working.

avatar image billingsleyjon Bonfire-Boy · Aug 31, 2016 at 02:21 PM 0
Share

Yep the html code that is produced by the print() is the same as the HT$$anonymous$$L code of the web page produced by the browser when I do that.

I will have to contact someone who works for the people who gave me the directions.

Show more comments
Show more comments

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Web Build Loading Slow 1 Answer

Browser-side WebPlayer application caching. 2 Answers

Display a (working) webpage inside of unity using flash? 1 Answer


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