I am using WCF service from this link:
Now here if you scroll down this link they have given an eg of how to create a client:
private void CreateClient(int mid)
{
ClientRecord client = new ClientRecord();
client.MerchantID = MerchantID;
client.FirstName = "Bob";
client.LastName = "Smith";
//other code describing client omitted
try
{
using (ClientServiceClient proxy = new ClientServiceClient())
{
int id = proxy.createClient(Authenticate.GetClientAuthTicket(txtID.Text.Trim(), txtKey.Text.Trim()), client);
Response.Write("Created Client ID = " + id.ToString());
}
}
catch (Exception e)
{
Response.Write(e.Message);
}
}
Now I dont understand what is this: ClientServiceClient??? I created the implementation like this:
public static PaymentsGatewayTest.Authentication GetClientAuthTicket (string APILogin, string key)
{
PaymentsGatewayTest.Authentication ticket = new PaymentsGatewayTest.Authentication();
ticket.APILoginID = APILogin;
ticket.UTCTime = DateTime.UtcNow.Ticks.ToString();
ticket.TSHash = GenerateTSHash(ticket.APILoginID + "|" + ticket.UTCTime, key.Trim());
return ticket;
}
private void CreateClient(int mid)
{
ClientRecord client = new ClientRecord();
client.MerchantID = 11245;
client.FirstName = "Bob";
client.LastName = "Smith";
//other code describing client omitted
try
{
using (PaymentsAuthClient proxy = new PaymentsAuthClient())
{
int id = proxy.createClient(Authenticate.GetClientAuthTicket("", "", client));
//Response.Write("Created Client ID = " + id.ToString());
}
}
catch (Exception e)
{
//Response.Write(e.Message);
}
}
I have create a Singleton class called PaymentsAuthClient, but this does not seems to work. What I am doing wrong here???
Thank you for your help in adv :)