FAQ frequently asked questions
General Questions
Yes, alternatively you can acquire the services of one.
The examples below are for reference only. They are created using the .NET Framework 4.7.2.
you are using erlier versions, yo may have to alter them to work
Add a new service reference that points to https://wslive.kevro.co.za/stockfeed.asmx
Dim stockFeed As ServiceReference1.StockFeedSoapClient = New ServiceReference1.StockFeedSoapClient()
' These are the HTTPS credentials that you will need will and can be saved in a DB or Application side
stockFeed.ClientCredentials.UserName.UserName = "Username"
stockFeed.ClientCredentials.UserName.Password = "Password"
stockFeed.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
stockFeed.Open()
'The below makes the login call to the api
' The Web service Login Credentials to use are provided in the welcome email when you sign up.
Dim Response As ServiceReference1.Response = stockFeed.login("Token", "Username", "Password", "Entity Name", EntityID)
' Callresult == true means the call was successful and you are now logged in.
If Response.Callresult = True Then
Response = stockFeed.GetFeedByEntityIDAndStockHeaderID(EntityID , "Username", "Password", "StockHeaderId", "Format")
' if you are going to periodically call the endpoints, call stockFeed.CheckIfSessionIsActive() and if that fails, log in again
If Response.Callresult = True Then
'the output is a string - formatted to the type specified in the call
Dim data As String = Response.ResponseData
' you will have to parse it into XML Or JSON - depending on the call above.
Dim JsonObject = Newtonsoft.Json.Linq.JObject.Parse(data)
Else
' handle the error gracefully
End If
Else
' handle the error gracefully
End If
Add a new service reference that points to https://wslive.kevro.co.za/stockfeed.asmx
StockFeedService.StockFeedSoapClient stockFeed = new StockFeedService.StockFeedSoapClient();
// These are the HTTPS credentials that you will need to authenticate the server.
stockFeed.ClientCredentials.UserName.UserName = "Username";
stockFeed.ClientCredentials.UserName.Password = "Password";
stockFeed.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
stockFeed.Open();
//The below makes the login call to the api
//The Web service Login Credentials to use are provided in the welcome email when you sign up.
StockFeedService.Response Response = stockFeed.login("Token", "Username", "Password", "Entity Name", EntityID);
// make sure you are logged in
if (Response.Callresult == true)
{
Response = stockFeed.GetFeedByEntityIDAndStockHeaderID( EntityID , "Username", "Password", "StockHeaderId", "Format");
// Callresult == true means the call was successful.
if (Response.Callresult == true)
{
// the output is a string - formatted
string data = Response.ResponseData;
// you will have to parse it into XML or JSON - depending on the call above.
var JsonObject = Newtonsoft.Json.Linq.JObject.Parse(data);
}
else
{
// handle the get feed error gracefully
}
}
else
{
// handle the login error gracefully
}
<?php
//define the wsdl url
$wsdlURL ='https://wslive.kevro.co.za/stockfeed.asmx';
// These are the HTTPS credentials that you will need to authenticate the server.
$credentials = array(
'login' => 'Username',
'password' => 'Password'
);
// create the client with wsdl and credentials
$client = new SoapClient($wsdlURL, $credentials);
// define the input parameters
//The Web service Login Credentials to use are provided in the welcome email when you sign up.
$Parameter = array(
'TokenKey' => 'Token',
'username' => 'Username',
'psw' => 'Password',
'EntityName' => 'Entity Name',
'entityID' => 'EntityID'
);
// call the login function with parameters
$response = $client->login($Parameter);
// as a test display the contentss
var_dump($response);
?>
In your app.config file, add the following properties to the binding
tag:
allowCookies="true" maxBufferPoolSize="524288" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
Add
<transport clientCredentialType="Basic" />
to the security tag
So then your binding should look like this:
<binding name="StockFeedSoap" >
<security mode="Transport" allowCookies="true" maxBufferPoolSize="524288" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<transport clientCredentialType="Basic" />
</security>
</binding>
.
Response = live.CheckIfSessionIsActive()
If Response.Callresult = True Then
'This means the session is still active and calls can be made.
Else
'This means the session has expired.
'Information regarding the error will be returned in the error msg section of the response class
End If
Response = live.CheckIfSessionIsActive();
If (Response.Callresult == True)
{
//This means the session Is still active And calls can be made.
}
else
{
//This means the session has expired, and you'll have to call login() again
//Information regarding the error will be returned in the error msg section of the response class
}
JSON
XML
CSV
XML
CSV