Operation method for post method (Expense item is class) :
WebInvoke(Method:="POST", UriTemplate:="CreateExpenseItem", RequestFormat:=WebMessageFormat.Json, ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Bare) _
Function CreateExpenseItem(ByVal objExpense As ExpenseItem) As Integer
Implementation method :
Public Function CreateExpenseItem(ByVal objExpense As ExpenseItem) As Integer Implements IHrmsService.CreateExpenseItem
Dim Output As Integer
Output = objEmployee.SaveExpenseDetails _
( _
objExpense.ExpensemasterID,objExpense.ExpenseID,
objExpense.Expensename, _
objExpense.ExpenseDate, _
objExpense.Amount, objExpense.Description, _
objExpense.EmpID _
)
Return Output
End Function
It is throwing 400 error while using through url in code but Im able to use Get methods :
http://116.145.199.252/ServiceHRMS/HrmsService.svc/web/CreateExpenseItem
Please can anyone help me ..
What Im I doing wrong ?