Jump to content
Sign in to follow this  
jason ho

Why GetPriceBars sometimes does not return back a GetPriceBarResponseDTO object or throw an error?

Recommended Posts

I am executing this line of code it worked first time but now it doesn’t return back anything after being called:

var ctx = new CIAPI.Rpc.Client(RPC_URI);
      ctx.LogIn(USERNAME, PASSWORD);

      try
        {
            GetPriceBarResponseDTO bars = ctx.GetPriceBars("71442", "MINUTE", 1, "15");

Share this post


Link to post
Guest sky.sanders

I am running this test multiple times and getting back a DTO. The collection is emtpy but the method completes successfully.

To track this issue we need to define ‘sometimes’ a little more explicitly. It may be a server error. Perhaps you can run Fiddler and watch the traffic?

Also, you are correct, the only two acceptable outcomes are a result or an exception. Let’s stay on top of this.

 [Test]
    public void Json_Ho_01()
    {

        var rpcClient = new Client(Settings.RpcUri);
        rpcClient.LogIn(Settings.RpcUserName, Settings.RpcPassword);

        GetPriceBarResponseDTO bars = rpcClient.GetPriceBars("71442", "MINUTE", 1, "15");
        Assert.IsNotNull(bars);

        rpcClient.LogOut();
    }

Share this post


Link to post

 

I am running this test multiple times and getting back a DTO. The collection is emtpy but the method completes successfully.

To track this issue we need to define ‘sometimes’ a little more explicitly. It may be a server error. Perhaps you can run Fiddler and watch the traffic?

Also, you are correct, the only two acceptable outcomes are a result or an exception. Let’s stay on top of this.

 [Test]
    public void Json_Ho_01()
    {

        var rpcClient = new Client(Settings.RpcUri);
        rpcClient.LogIn(Settings.RpcUserName, Settings.RpcPassword);

        GetPriceBarResponseDTO bars = rpcClient.GetPriceBars("71442", "MINUTE", 1, "15");
        Assert.IsNotNull(bars);

        rpcClient.LogOut();
    }

’m running fiddler now and will analyse the traffic more and see if I can reproduce.

I’ve made a test harness and it seems when the connection is fine I get back a result I see if I can get anymore information when testing today.

However I still cannot get any bars back when I am expecting some for this marketid, any ideas?

Share this post


Link to post
Guest mrdavidlaing

 

I am running this test multiple times and getting back a DTO. The collection is emtpy but the method completes successfully.

To track this issue we need to define ‘sometimes’ a little more explicitly. It may be a server error. Perhaps you can run Fiddler and watch the traffic?

Also, you are correct, the only two acceptable outcomes are a result or an exception. Let’s stay on top of this.

 [Test]
    public void Json_Ho_01()
    {

        var rpcClient = new Client(Settings.RpcUri);
        rpcClient.LogIn(Settings.RpcUserName, Settings.RpcPassword);

        GetPriceBarResponseDTO bars = rpcClient.GetPriceBars("71442", "MINUTE", 1, "15");
        Assert.IsNotNull(bars);

        rpcClient.LogOut();
    }

@jason ho Please include some Fiddler logs – make sure they include the timestamp of the requests, and your Username & Session. I’ll go trawling through the server side logs tomorrow and see if I can get some more detail.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×