Exception: Operation xx of contract xx specifies multiple request body parameters to be serialized without any wrapper elements.
Operation 'CreateProductCodeStock' of contract 'IChileService' specifies multiple request body parameters to be serialized without any wrapper elements.
At 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
It seems that you have created Proxy code using Add Service Reference dialog in VS, Since WCF REST Service is 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 this similar post.
It seems you have created Proxy code using Add Service Reference dialog in VS.
VS ASR dialog doesn't support 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?
是因为缺少了attribute导致的。
解决方法,不使用添加ServiceReference的方式获取。直接调用Service的library
Exception: Operation xx of contract xx specifies multiple request body parameters to be serialized without any wrapper elements.的更多相关文章
- Linux内核中的Kconfig、xx.defconfig、xx.config、Makefile
什么是Kconfig.xx.defconfig.xx.config.Makefile Kconfig: 一个文本形式的文件,其中主要作用是在内核配置时候,作为配置选项. xx.deconfig: Li ...
- (转)JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
在linux环境下配置项目运行环境时,部署的人员都会分配一下内存,以保证程序正常的运行.其实在开发的时候(window系统),就已经涉及到内存分配了,只是这些参数有默认值,因此一直没有去重视它. 以M ...
- eclipse不能自动编译XX.java为XX.classs
问题描述:eclipse不能自动编译XX.java为XX.classs 原因:今天下午写代码,因为需要引入jstl包,引入后发现原来项目中已经引入了,然后我又把包删除了,忘记删除java build ...
- myeclipse -vmargs -Xmx512m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=64m
myeclipse.ini把里面的参数为 -vmargs -Xmx512m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=64m 以对于我而言,我只要把 ...
- jvm参数设置 -vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M
-vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M 这里有几个问题: 1. 各个参数的含义什么? 2. 为什么有的机器我将- ...
- rpm卸载包遭遇 specifies multiple packages 错误
使用 rpm删除软件时报错如下: [root@hostxxlidan]# rpm -qa |grep -i mysqlmysql-devel-5.0.95-5.el5_9mysql-devel-5.0 ...
- 小知识点 之 JVM -XX:MaxGCPauseMillis 与 -XX:GCTimeRatio
写在前边 JVM调优更多是针对不同应用类型及目标进行的调整,往往有很大的实验成份,通过实验来针对当前应用设置相对合适的参数,提高应用程序的性能与稳定性 最近在复习JVM,Parallel Scaven ...
- 【异常及源码分析】org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping
一.异常出现的场景 1)异常出现的SQL @Select("SELECT\n" + " id,discount_type ,min_charge, ${cardFee} ...
- -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
-Xms 最小堆的大小, 也就是当你的虚拟机启动后, 就会分配这么大的堆内存给你 -Xmx 是最大堆的大小 当最小堆占满后,会尝试进行GC,如果GC之后还不能得到足够的内存(GC未必会收集到所有当前可 ...
随机推荐
- 【BZOJ4448】【SCOI2015】情报传递
这题面错别字真tm多 题意: Description 奈特公司是一个巨大的情报公司,它有着庞大的情报网络.情报网络中共有n名情报员.每名情报员口J-能有若T名(可能没有)下线,除1名大头日外其余n-1 ...
- 在pycharm中配置Anaconda以及pip源配置
在学习推荐系统.机器学习.数据挖掘时,python是非常强大的工具,也有很多很强大的模块,但是模块的安装却是一件令人头疼的事情. 现在有个工具--anaconda,他已经帮我们集成好了很多工具了!an ...
- MySQL 以及 Python 实现排名窗体函数
大部分数据库都提供了窗体函数.比方RANK,ROW_NUMBER等等. MySQL 这方面没有直接提供.可是能够变相的实现.我曾经写了row_number 的实现,今天有时间把 rank 的实现贴出来 ...
- 管理ONS(Oracle Notification Service)
Onsctl Onsctl这个命令是用来管理ONS(Oracle Notification Service)是OracleClustser实现FAN Event Push模型的基础. Oracle N ...
- Git(三):加入与提交
在这一节.接着使用上一节的代码样例往下讲,http://blog.csdn.net/troy__/article/details/39806245. 加入文件到暂存区 加入新文件和改动版本 ...
- 几种常见sqlalchemy查询:
#简单查询 print(session.query(User).all()) print(session.query(User.name, User.fullname).all ...
- How to Download Windows 10 Spotlight/Lock Screen Images
http://www.online-tech-tips.com/windows-10/download-windows-10-spotlight-lock-screen-images/ 图片位置 C: ...
- 版本控制器:SVN(精讲)
版本控制器:SVN 1 开发中的实际问题 1.1 小明负责的模块就要完成了,就在即将Release之前的一瞬间,电脑突然蓝屏,硬盘光荣牺牲!几个月来的努力付之东流——需求之一:备份! 1.2 这个项目 ...
- 【DNN 系列】 DNN是什么
DNN平台 这个DNN平台是一个开放的.可扩展的.安全的.可扩展的内容管理系统和ASP.NET.世界各地的数十万商户,从地方小企业到全球1000强企业,取决于DNN平台作为他们网站的编辑环境. 这个网 ...
- RelativeLayout中的baseline
比如,加入两个相邻的TextView,给第二个TextView一个大一点的padding(比如20dp),如果加了layout_alignBaseline到第二个TextView中的话, TextVi ...