PDA

View Full Version : How to get Price of items from xls sheet present at our server



gld1881
08-06-2013, 09:17 AM
currently i am using http://74.54.46.178/vertexweb10/WebService.svc webservice to show price on our website home page (www.gld1881.com)

I want to develop price feed for my website connected to my application server. For this i want to access excel sheet or original price feed program or webservice running on my server.

Please guide me regarding this.

Hassan-HS
08-06-2013, 10:14 AM
Dear Sir,
Thank you for contacting us, You can use "GetNewTick (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1939)" method to get Bid/Ask, High/Low prices for any symbol that occurred changes on its information

Note: You must login using this method "Login (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1949)" before use "GetNewTick (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1939)"


The following sample describe how to get prices using our web service





<!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>GetNewTick</title>

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

</head>

<script >

var urlStr = "http://74.54.46.178/vertexweb10/WebService.svc";

function startGetNewTick() {

$.getJSON(urlStr + "/GetNewTick?callback=?", onSuccessResultAction);

}

function onSuccessResultAction(dataResult) {

result = eval('(' + dataResult + ')');

if (result == -201) {

var errDetail = "http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964"

$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));

}

if (result.Symbols.length > 0) {

var myTable = '<table border="1px"><thead>' +

'<tr><th>Symbol </th><th> Bid</th>' +

'<th >Ask</th><th>High</th><th>Low</th><th>Time</th></tr></thead><tbody>';

for (var i = 0; i <= result.Symbols.length - 1; i++) {

myTable += "<tr>"

myTable += "<td>" + result.Symbols[i].I + "</td>"

myTable += "<td>" + result.Symbols[i].A + "</td>"

myTable += "<td>" + result.Symbols[i].B + "</td>"

myTable += "<td>" + result.Symbols[i].H + "</td>"

myTable += "<td>" + result.Symbols[i].L + "</td>"

//myTable += "<td>" + result.Symbols[i].LastQuoteTime + "</td>"

myTable += "</tr>"

}

myTable += '</tbody></table>';

$("#resultAction").html(myTable);

}

else { $("#resultAction").html("No Price Update"); }

setTimeout('startGetNewTick()', '2000');

}

$(document).ready(function () {

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 {

$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);

}

}

$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });

function onErrorResult(result) {

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

}

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

$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);

});

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

startGetNewTick();

});

});

</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>

<tr>

<td>AccountID: <input type="text" id="txtAccountID" value ="12347298" /> </td>

<td><button id="btnAction"> Start GetNewTick </button></td>

</tr>

</tbody>

</table>

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

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

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

</body>

</html>

gld1881
08-06-2013, 10:49 AM
i am already using this service as you can see on site. But i want to get data form my server not from 74.54.46.178/vertexweb10/

I tried to change this with our server address but its not working. So i want to access same data which gives feed to our application or excel feed file on server.

Hassan-HS
08-06-2013, 11:25 AM
Dear Sir,



I got your point, you should change the link from as following:
http://74.54.46.178/vertexweb10/WebService.svc to http://Your Web Trader Link/WebService.svc



This means your web service link : http://5.153.9.98/webtrader/WebService.svc :D

gld1881
08-06-2013, 12:39 PM
Now I am able to connect and get data, but please provide me the symbol id for Gold Oz, Silver Oz, Platinum Oz and Palladium Oz of my server. I tried to find from Symbol definitions application from our server, but i am not able to find gold Oz and platinum where as silver Oz has two symbol 10 and 20.

Hassan-HS
08-06-2013, 01:35 PM
Dear Sir,

You can use this code to return all symbols for special account using this method GetAllSymbols (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1935)


1- Login :
http://5.153.9.98/webtrader/WebService.svc/login?Username="support"&Password="support"
2-Lunch this link
http://5.153.9.98/webtrader/WebService.svc/GetAllSymbols?AccountID=100000

Or you can use GetSymbol (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1944)

gld1881
08-19-2013, 08:24 AM
previously this service is working fine, but now i am getting -200 error.

webservices is working and i am using same program. then where is problem and how to solve it

gld1881
08-19-2013, 08:48 AM
for you quick reference please review my code ....


<!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>GetNewTick</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
var urlStr = "http://5.153.9.98/webtrader/WebService.svc";
function startGetNewTick() {
$.getJSON(urlStr + "/GetNewTick?callback=?", onSuccessResultAction);
}
function onSuccessResultAction(dataResult) {
result = eval('(' + dataResult + ')');
if (result == -201) {
var errDetail = "http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964"
$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));
}
if (result.Symbols.length > 0) {
var myTable = '<table border="1px"><thead>' +
'<tr><th>Symbol </th><th> Bid</th>' +
'<th >Ask</th><th>High</th><th>Low</th><th>Time</th></tr></thead><tbody>';
for (var i = 0; i <= result.Symbols.length - 1; i++) {
myTable += "<tr>"
myTable += "<td>" + result.Symbols[i].I + "</td>"
myTable += "<td>" + result.Symbols[i].A + "</td>"
myTable += "<td>" + result.Symbols[i].B + "</td>"
myTable += "<td>" + result.Symbols[i].H + "</td>"
myTable += "<td>" + result.Symbols[i].L + "</td>"
//myTable += "<td>" + result.Symbols[i].LastQuoteTime + "</td>"
myTable += "</tr>"
}
myTable += '</tbody></table>';
$("#resultAction").html(myTable);
}
else { $("#resultAction").html("No Price Update"); }
setTimeout('startGetNewTick()', '2000');
}
$(document).ready(function () {
jQuery.support.cors = true;
startGetNewTick();
});
</script>
<body>
<div id="resultData"> </div>
<div id="resultAction"> </div>
<div style="display:none" id="progress">Loading ... </div>
</body>
</html>

b_morar
08-19-2013, 11:10 AM
Dear Sir,

Please create new demo account using CreateDemoAccount (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1961) and will work fine.
kindly , provide me with the login information that you have used before .

gld1881
08-19-2013, 11:27 AM
I think you have post in wrong thread. This is about price ticker. Reference code -

http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1939

Please go to my previous reply, where i have given a code detail which is for showing price on website. That program gives -200 error.

Create Demo Account is another thread which i have created.

b_morar
08-19-2013, 12:48 PM
Dir Sir,

No it is right thread.
Please give me your old login info so i can check if this account is valid or expired to trace this case.
If it was expired you need to create new account.

gld1881
08-20-2013, 10:27 AM
login detail used -
Username = VertexFX

Password = LJKSDF8645J

Salah-HS
08-20-2013, 12:50 PM
Dir Sir,
after we traced the case we have found that
the Account you use is expired so you need to create new account.

gld1881
08-21-2013, 05:42 AM
i am not using login information for getting prices. please see my codes. previously is was working fine without using login information. and moreover i am not willing to using login information to show prices on website.

b_morar
08-21-2013, 08:25 AM
Dear Sir,

I'm working on it , Please stand by.

Salah-HS
08-21-2013, 09:59 AM
Dear sir,

In the previous code you used the GetNewTick method which needs a login befor using it.
However you can use the GetMwNewTick which doesn't need a login before using it as you see in the following code:


<!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>GetNewTick</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
var urlStr = "http://5.153.9.98/webtrader/WebService.svc";
function startGetNewTick() {
$.getJSON(urlStr + "/GetMWNewTick?callback=?", onSuccessResultAction);
}
function onSuccessResultAction(dataResult) {
result = eval('(' + dataResult + ')');
if (result == -201) {
var errDetail = "http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964"
$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));
}
if (result.Symbols.length > 0) {
var myTable = '<table border="1px"><thead>' +
'<tr><th>Symbol </th><th> Bid</th>' +
'<th >Ask</th><th>High</th><th>Low</th><th>Time</th></tr></thead><tbody>';
for (var i = 0; i <= result.Symbols.length - 1; i++) {
myTable += "<tr>"
myTable += "<td>" + result.Symbols[i].I + "</td>"
myTable += "<td>" + result.Symbols[i].A + "</td>"
myTable += "<td>" + result.Symbols[i].B + "</td>"
myTable += "<td>" + result.Symbols[i].H + "</td>"
myTable += "<td>" + result.Symbols[i].L + "</td>"
//myTable += "<td>" + result.Symbols[i].LastQuoteTime + "</td>"
myTable += "</tr>"
}
myTable += '</tbody></table>';
$("#resultAction").html(myTable);
}
else { $("#resultAction").html("No Price Update"); }
setTimeout('startGetNewTick()', '2000');
}
$(document).ready(function () {
jQuery.support.cors = true;
startGetNewTick();
});
</script>
<body>
<div id="resultData"> </div>
<div id="resultAction"> </div>
<div style="display:none" id="progress">Loading ... </div>
</body>
</html>

gld1881
08-21-2013, 10:38 AM
Thanks for updated links. Can you please send my the new file names, as you change here from GetNewTick to GetMWNewTick, for other services like create demo account, create live account and so on.

b_morar
08-21-2013, 11:30 AM
Dear Sir,

Please let me know what do you mean by "the new file names" .

gld1881
08-21-2013, 12:25 PM
is something going wrong again. Prices in this list are not changing. Please check it.

b_morar
08-21-2013, 01:20 PM
Dear Sir,

Prices in list are changing now, Please check again and update me

b_morar
09-12-2013, 07:58 AM
Dear Sir,


Kindly update us, if every thing going well with you.