Christian Gonzalez
Christian Gonzalez

Reputation: 13

WCF Error With WebInvoke BodyStyle Wrapped

I have a problem when trying to create a method that takes 2 or more parameters. I specified to use Wrapped BodyStyle on the operationcontract but anyways it gives an error like if I wasn't using it.

Interface:

[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = 
"/DaysDeleteBusinessDay", RequestFormat = WebMessageFormat.Json, 
ResponseFormat = WebMessageFormat.Json, Method = "POST")]
[OperationContract]
void DaysDeleteBusinessDay(int BusinessesId, int Id);

Service:

[WebInvoke]
public void DaysDeleteBusinessDay(int BusinessesId, int Id)
{
    Logic.LogicFabric.GetLogicDays().DeleteBusinessDay(BusinessesId, Id);
}

Upvotes: 1

Views: 1160

Answers (1)

Christian Gonzalez
Christian Gonzalez

Reputation: 13

Well, I managed to solve the problem, I also added to the definition of the method in the service

[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]
public void DaysDeleteBusinessDay(int BusinessesId, int Id)

And thats all.

Thanks to all!

Upvotes: 0

Related Questions