Operation ' Createproductcodestock ' of contract ' Ichileservice ' specifies multiple request body parameters to be serialized Without any wrapper elements.
At the most one body parameter can be serialized without wrapper elements.
Either remove the extra body parameters or set the Bodystyle property on the Webgetattribute/webinvokeattribute to wrapped .
StackTrace:
At System.ServiceModel.Description.WebHttpBehavior.TryGetNonMessageParameterType (Messagedescription message, OperationDescription declaringoperation, Boolean isrequest, type& Type)
At System.ServiceModel.Description.WebHttpBehavior.ValidateBodyStyle (OperationDescription operation, Boolean Request
At System.servicemodel.description.webhttpbehavior.<>c__displayclass70_1.<getrequestclientformatter >b__1 ()
At System.servicemodel.description.webhttpbehavior.<>c__displayclass70_0.<getrequestclientformatter >b__0 ()
At System.ServiceModel.Description.WebHttpBehavior.HideReplyMessage (OperationDescription operationdescription, Effect Effect)
At System.ServiceModel.Description.WebHttpBehavior.GetRequestClientFormatter (operationdescription OperationDescription, ServiceEndpoint Endpoint)
At System.ServiceModel.Description.WebHttpBehavior.ApplyClientBehavior (ServiceEndpoint endpoint, clientruntime ClientRuntime)
At System.ServiceModel.Description.DispatcherBuilder.ApplyClientBehavior (ServiceEndpoint ServiceEndpoint, ClientRuntime clientruntime)
At System.ServiceModel.Description.DispatcherBuilder.BuildProxyBehavior (ServiceEndpoint ServiceEndpoint, bindingparametercollection& parameters)
At System.ServiceModel.Channels.ServiceChannelFactory.BuildChannelFactory (ServiceEndpoint ServiceEndpoint, Boolean useactiveautoclose)
At System.ServiceModel.ChannelFactory.CreateFactory ()
At System.ServiceModel.ChannelFactory.OnOpening ()
At System.ServiceModel.Channels.CommunicationObject.Open (TimeSpan timeout)
At System.ServiceModel.ChannelFactory.EnsureOpened ()
At System.ServiceModel.ChannelFactory ' 1.CreateChannel (endpointaddress address, Uri via)
At System.ServiceModel.ChannelFactory ' 1.CreateChannel ()
At WcfTest.Program.Main (string[] args) in D:\chucklu\git\edenred\wcftest\wcftest\program.cs:line 18
At system.appdomain._nexecuteassembly (runtimeassembly Assembly, string[] args)
At System.AppDomain.ExecuteAssembly (String assemblyfile, Evidence assemblysecurity, string[] args)
At Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly ()
At System.Threading.ThreadHelper.ThreadStart_Context (Object State)
At System.Threading.ExecutionContext.RunInternal (ExecutionContext ExecutionContext, ContextCallback callback, Object state, Boolean Preservesyncctx)
At System.Threading.ExecutionContext.Run (ExecutionContext ExecutionContext, ContextCallback callback, Object State, Boolean preservesyncctx)
At System.Threading.ExecutionContext.Run (ExecutionContext ExecutionContext, ContextCallback callback, Object State)
At System.Threading.ThreadHelper.ThreadStart ()
Source:
System.ServiceModel.Web
Https://forums.asp.net/t/1749250.aspx? exception+operation+xx+of+contract+xx+specifies+multiple+request+body+parameters+to+be+serialized+without+any+ wrapper+elements+
It seems that you had created Proxy code using ADD Service Reference dialog in VS, Since WCF REST Service was not based on SOAP message, so Add Service Reference doesn ' t support WCF REST Service fully, and the proxy code is missing [WebInvoke] Attribute. Try creating proxy code using ADD Web Reference in VS. Please check the this similar post.
Stackoverflow.com/questions/4346554/wcf-service-proxy-throws-exception-when-more-than-one-parameter-is-used-in-oper
It seems created Proxy code using ADD Service Reference dialog in VS.
VS ASR Dialog doesn ' t support for WCF REST fully, so, the proxy code is missing [WebInvoke] attribute.
Can you try adding [WebInvoke (bodystyle = webmessagebodystyle.wrapped)] attribute on operations in client proxy?
Because of the lack of attribute caused.
Workaround, do not use Add ServiceReference method to get. Call the service's library directly
exception:operation XX of contract XX specifies multiple request body parameters to being serialized without any wrapper ele ments.