Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I developed REST service to insert the data in database and this is my code :
C#
[OperationContract]
      [WebInvoke(UriTemplate = "Comp", Method = "POST", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml)]
      void CreateCompany(Company company);

I implemented that CreateCompany() method.
My endpoint address is "http://localhost:8732/Design_Time_Addresses/RESTAppointments/Service1/ed"

and in advanced rest client I am sending this input
XML
<CreateCompany>
<CompanyName>Kamineni</CompanyName>
<AppointmentStartTime>10</AppointmentStartTime>
<AppointmentEndTime>19</AppointmentEndTime>
<BreakStartTime>14</BreakStartTime>
<BreakEndTime>15</BreakEndTime>
<Interval>15</Interval>
</CreateCompany>

URL I am giving is:http://localhost:8732/Design_Time_Addresses/RESTAppointments/Service1/Comp[^]


Now I want to test it using Advanced REST client in the browser .However when I make a request Iam getting error:
400 Bad Request :Response doesnot contain any data

Where Am I going wrong ?How to test it to insert data ?

Thanks,,
Posted
Comments
Andrei Straut 4-Sep-12 5:19am    
I don't know much about developing REST webservices in .NET, but shouldn't you have a return value for the CreateCompany method?

(Posted this as a comment instead of a solution, because it's more of an idea/suggestion, and an extremely short one at that)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900