Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by aroda · May 17, 2015 at 08:17 PM · jsonunity 4.6assetstore

WAK - WebAPIKit - on-complete error when retrieving JSON

I am using WAK (Web API Kit) to retrieve JSON from my server but I have a problem with on-complete action and no matter what I do, I can't figure out a way to solve it. Any help would be appreciated.

This is the error I get:


 {ERR} [184044FE]'on-complete' User Action invocation failed hard with error: Exception has been thrown by the target of an invocation.
 UnityEngine.Debug:LogError(Object)
 hg.ApiWebKit.Configuration:Log(String, LogSeverity) (at Assets/WAK.core/WAK/CORE/Configuration.cs:175)
 hg.ApiWebKit.Configuration:LogInternal(String, String, LogSeverity) (at Assets/WAK.core/WAK/CORE/Configuration.cs:198)
 hg.ApiWebKit.core.http.HttpOperation:Log(String, LogSeverity) (at Assets/WAK.core/WAK/CORE/core/http/HttpOperation.cs:29)
 hg.ApiWebKit.core.http.HttpOperation:tryUserAction(String, Object[]) (at Assets/WAK.core/WAK/CORE/core/http/HttpOperation.cs:242)
 hg.ApiWebKit.core.http.HttpOperation:<SendRequest>m__4(HttpResponse) (at Assets/WAK.core/WAK/CORE/core/http/HttpOperation.cs:213)
 hg.ApiWebKit.core.http.HttpAbstractProvider:BehaviorComplete() (at Assets/WAK.core/WAK/CORE/core/http/HttpAbstractProvider.cs:128)
 hg.ApiWebKit.providers.<sendImplementation>c__IteratorB:MoveNext() (at Assets/WAK.core/WAK/providers/HttpWWWClient.cs:59)


And this is the code:

PlayerManager.cs

This is where the log complains on the line TextCash.text = operation.response.Cash.ToString(); What I don't understand is that if I do a print log of operation.response.Cash it works without problems and I use similar code in other classes and I have no problem.


 namespace hg.ApiWebKit.cyclingsim.client
 {
     public class PlayerManager : MonoBehaviour
     {
 
         public GameObject CurrenciesGameObj; //this is the gameObject that holds the currencies text components inside
         public GameObject UserProfileGameObj; //this is the gameObject that holds the user profile info like Level and Energy text components inside
 
         public Slider NRJSlider;
 
         public Text TextPlayerLevel;
         public Text TextEnergyTimer;
         public Text TextXPToNextLevel;
 
         public Text TextTrainingPoints;
         public Text TextGems;
         public Text TextCash;
 
         public IEnumerator SqlLoad(string playerid)
         {
             yield return new WaitForSeconds(2.0f);
 
             new hg.ApiWebKit.cyclingsim.operations.LoadPlayer()
             {
                 playerid = playerid
             }.Send(null, null, onComplete);
 
             yield break;
         }
 
         private void onComplete(LoadPlayer operation, hg.ApiWebKit.core.http.HttpResponse response)
         {
             // Update currencies
             TextCash.text = operation.response.Cash.ToString();
            ...
          }


LoadPlayer.cs


 namespace hg.ApiWebKit.cyclingsim.operations
 {
     [HttpGET]
     [HttpPath("mytestproj", "/v1/players/{$playerid}")]
     [HttpProvider(typeof(hg.ApiWebKit.providers.HttpWWWClient))]
     [HttpAccept("application/json")]
     [HttpContentType("application/x-www-form-urlencoded; charset=UTF-8")]
     [HttpRequestHeader(
         VariableName = "myAuthHeaderName",
         VariableValue = "myAuthHeaderValue")]//,
     //Converter= typeof(hg.ApiWebKit.converters.BasicAuthEncode))]
     public class LoadPlayer : HttpOperation
     {
         [HttpUriSegment("playerid")]
         public string playerid;
 
         [HttpResponseJsonBody] // expected JSON object response
         public models.Player response;
     }
 }


Any ideas ?

Thanks in advance

Comment
Add comment · Show 1
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 Chris-HG · Oct 08, 2015 at 12:48 PM 0
Share

I would have to see your Player model. A hard failure like that usually leads to some issue in the user code.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Chris-HG · Oct 08, 2015 at 12:46 PM

Hi @aroda. I just found this post. If you still have a problem please submit @ http://haptixgames.com/forum/viewforum.php?f=13.

/chris

Comment
Add comment · 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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Create animation sequence from different FBX models 1 Answer

Sprite moving like a flag? 0 Answers

Is there a way to have realistic leaves that can be "raked"? 0 Answers

Animated game controller asset 1 Answer

Unity 4.6 UI - change image's source image via script 4 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