HAVE A SMALL REQUIREMENT
am trying to create a custom object using salesforce rest api ..here is my code
req=new Httprequest();
req.setEndpoint('https://ap1.salesforce.com/services/Soap/u/22.0/xxxxx')
string b ='
<?xml version="1.0" encoding="UTF-8"?>'+
'<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">'+
'<deploymentStatus>Deployed</deploymentStatus>'+
'<description>just a test object with one field for eclipse ide testing</description>'+
'<fields>'+
'<fullName>Comments__c</fullName>'+
'<description>add your comments about this object here</description>'+
'<inlineHelpText>This field contains comments made about this object</inlineHelpText>'+
'<label>Comments</label>'+
'<length>32000</length>'+
'<type>LongTextArea</type>'+
'<visibleLines>30</visibleLines>'+
'</fields>'+
'<label>MyFirstObject</label>'+
'<nameField>'+
'<label>MyFirstObject Name</label>'+
'<type>Text</type>'+
'</nameField>'+
'<pluralLabel>MyFirstObjects</pluralLabel>'+
'<sharingModel>ReadWrite</sharingModel>'+
'</CustomObject>';
req.setHeader('Authorization','OAuth '+SESSION_ID);
req.setMethod('POST');
req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
req.setHeader('SOAPAction', '""');
req.setbody(b);
p =new Http();
res=new Httpresponse();
res=p.send(req) ;
here is my error message
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:VersionMismatch</faultcode>
<faultstring>The SOAP request must use SOAP 1.1, did not recieve a SOAP 1.1 Envelope as the document root</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>