Quantcast
Viewing all articles
Browse latest Browse all 8433

Re: The specified HTTP method is not allowed for the resource identified

Manish,

 

Now that you have used the right method, problem is with the format of the body.

A sample request body looks as below. (http://www.odata.org/documentation/odata-v2-documentation/operations/#26_Updating_Entries)

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Entry xml:base="http://services.odata.org/OData/OData.svc/"
    xmlns:d=" http://schemas.microsoft.com/ado/2007/08/dataservices"
    xmlns:m=" http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
    xmlns="http://www.w3.org/2005/Atom">
  <id>http://services.odata.org/OData/OData.svc/Products(1)</id>
  <title type="text"></title>
  <updated>2010-02-28T10:23:02Z</updated>
  <author>
    <name />
  </author>
  <Link rel="edit" title="Product" href="Products(1)" />
  <category term="DataServiceProviderDemo.Product"
      scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>
      <d:ID m:type="Edm.Int32">1</d:ID>
      <d:Name>Milk</d:Name>
      <d:Description>Low fat milk</d:Description>
      <d:ReleaseDate m:type="Edm.DateTime">1995-10-21T00:00:00</d:ReleaseDate>
      <d:DiscontinuedDate m:type="Edm.DateTime" m:null="true" />
      <d:Rating m:type="Edm.Int32">4</d:Rating>
      <d:Price m:type="Edm.Decimal">4.5</d:Price>
    </m:properties>
  </content>
</Entry>

 

That is it has an <?xml> and <Entry> tags.

You do not seem to be passing <Entry> tag.

 

Thanks

Krishna


Viewing all articles
Browse latest Browse all 8433

Trending Articles