PDA

View Full Version : Problem connecting to the server



Muneeb100
01-27-2014, 12:43 PM
Hello,

I am able to use VertexFX API using the credentials (user:support passw:support) mentioned in samples but can't access using the link provided by support team to test the services. The information is given below
"37.58.66.34/webtrader/WebService.svc

UserName: binarytest
Password : test123
"

I have replaced the url of webservice in the samples along with username and password, but unfortunately they are not working. Can you please tell me if there is problem at server side or am I doing something wrong?

Thank you!

Muneeb100
01-27-2014, 02:46 PM
Can you also please tell me what are Stop & Limit Offsets associated with the account? Thanks

Hassan-HS
01-27-2014, 02:48 PM
Hello,


Can you please send me the samples, i have logged in with your demo account using WCF and its logged in successfully.





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Login</title>

<script src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<script >

$(document).ready(function () {

var urlStr = "http://37.58.66.34/webtrader/WebService.svc";

jQuery.support.cors = true;

$("#progress").ajaxStart(function () { $(this).css("display", "block"); });

$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });

function onSuccessResult(response) {

response = eval('(' + response + ')')

if (response.UserId == -1 || response.UserId == -207) {

$("#resultData").html("Invalid username or password");

}

else if (response.UserId == -231) {

$("#resultData").html("You must have at least one account");

}

else if (response == null || response == "" || response.UserId < 0) {

$("#resultData").html("Error while login.Please try later");

}

else {

var resultStr = "SuccessResult ... UserId is :" + response.UserId + "<br/>";

resultStr += "DemoClient :" + response.DemoClient + " (if ClientType=0 then the Client Type is real . else if ClientType=1 then the Client Type is Demo) " + "<br/>"

resultStr += "IsReadOnly :" + response.isReadOnly + "<br/>"

resultStr += "Second Name :" + response.SName + "<br/>"

resultStr += "Third Name :" + response.TName + "<br/>"

$("#resultData").html(resultStr);

}

}

function onErrorResult(result) {

alert('Service call faild : ' + result.status + ' ' + result.statusText);

}

$("#btnLogin").click(function () {

$.ajax({

url: urlStr + "/Login",

data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },

traditional: true,

crossDomain: true,

dataType: "jsonp",

success: onSuccessResult,

error: onErrorResult

});

});

});

</script>

<body >

<table border="1px">

<tbody>

<tr>

<td>

username: <input type="text" id="txtusername" value="support"/>

password: <input type="text" id="txtpassword" value="support"/>

<button id="btnLogin"> Login </button>

</td>

</tr>

</tbody>

</table>

<div id="resultData"> </div>

<div id="resultAction"> </div>

<div style="display:none" id="progress">Loading ... </div>

</body>

</html>