CALL TO AIF Web Service in C#

Hi

I have created a web service for RetailTransactionTable and calling it in C# .I want to insert data into ax database from VS.

Data is inserted into t table if i give the TransactionId.But i wanted to autopopulate the field.

But im not able to insert t record if I leave tat field.Its saying creation has been cancelled.

Note:I referred the following artilcle for this

http://msdn.microsoft.com/en-us/library/ff628055(v=ax.50).aspx

RtlServRef.

RtlTrxServiceClient proxy = new RtlServRef.RtlTrxServiceClient

();

AxdRtlTrx trans = new AxdRtlTrx

();

AxdEntity_RetailTransactionTable_1[] trx = new AxdEntity_RetailTransactionTable_1

[1];

EntityKey

[] keys;

EntityKey

key;

KeyField

fld;

CallContext cntxt = new CallContext

();

cntxt.Company =

“dat”

;

cntxt.Language =

“en-us”

;

// Create an instance of the document class.

trx[0] =

new AxdEntity_RetailTransactionTable_1

();

trx[0].InvoiceId =

“12345”

;

// trx.TransactionId = “”;

trx[0].ReceiptId =

“23456789”

;

trx[0].TransDate =

DateTime

.Today;

trx[0].NetAmount = -1000;

trx[0].GrossAmount = -1000;

trx[0].PaymentAmount = 1000;

trx[0].NumberOfItems = 1;

trx[0].Currency =

“USD”

;

trx[0].ExchRate = 100;

trans.RetailTransactionTable_1 = trx;

/* trans.DocPurpose = AxdEnum_XMLDocPurpose.Original;

trans.DocPurposeSpecified = true;*/

//string res = keys[0].KeyData[1].Value.ToString();

keys = proxy.create(cntxt, trans);

key = keys[0];

fld = key.KeyData[0];

Console.WriteLine("id " + fld.Value + “created”

);

Kindly suggest

Regards

maheswari