Below is some code that shows how the UpdateRecord() method can be invoked using the SOAP Web Services.  I have discussed the use of the Update() method in the article "Updating Multiselect fields using the Web Service Interface" and it is import to realise the Update() and UpdateRecord() methods are just as different as the Add() and AddRecord() methods.

The code will update a Case (case_caseid = 22) and set the description field to 'Test'.

[code language=c#]
ewarebase[] CRMBase;
crmrecord[] CaseList = new crmrecord[1];
crmrecord myCase = new crmrecord();
myCase.entityname = "Case";
myCase.records = new recordfield[2];
myCase.records[0] = Getrecordfield("caseid", "22", "integer");
myCase.records[1] = Getrecordfield("description", "Test", "string");
CaseList[0] = myCase;

CRMBase = CaseList;
updateresult CRMUpdateRecordResult = CRMService.updaterecord("Case", CRMBase);
[/code]

This code makes use of a function 'Getrecordfield' below.

[code language=c#]
private static recordfield Getrecordfield(string name, string avalue, string type)
{
recordfield aField = new recordfield();
aField.name = name;
aField.value = avalue;
switch (type)
{
case "string": aField.type = crmrecordtype.@string;
break;
case "datetime": aField.type = crmrecordtype.datetime;
break;
case "integer": aField.type = crmrecordtype.integer;
break;
case "decimal": aField.type = crmrecordtype.@decimal;
break;
case "crmrecord": aField.type = crmrecordtype.crmrecord;
break;
case "multiselectfield": aField.type = crmrecordtype.multiselectfield;
break;
}
aField.typeSpecified = true;
return aField;
}
[/code]

Not every one writes in C# so the actual XML that is passed can be seen here:

[code language=xml]
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<SessionHeader xmlns="http://tempuri.org/type">
<sessionId>68306995826605</sessionId>
</SessionHeader>
</soap:Header>
<soap:Body>
<updaterecord xmlns="http://tempuri.org/type">
<entityname>Case</entityname>
<records xsi:type="crmrecord">
<entityname>Case</entityname>
<records>
<name>caseid</name>
<type>integer</type>
<value>22</value>
</records>
<records>
<name>description</name>
<type>string</type>
<value>Test</value>
</records>
</records>
</updaterecord>
</soap:Body>
</soap:Envelope>
[/code]

I hope this is useful.