Service References to a MTOM web services
2015-09-18 15:03
211 查看
In VS2013, we tried to add a web service wsdl and the reference.cs is always empty. As per the web service provider, we tried to below command by svcutil.exe to generate the reference.cs and .config file
· svcutil [wsdl url] /out:references.cs /serializer:XmlSerializer
https://msdn.microsoft.com/en-us/library/aa347733%28v=vs.110%29.aspx
with below configuration for binding generated by the tool, the web service will returns an exception saying something like not expected content type
<basicHttpBinding>
<binding name="SlsServiceWSSoapBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
We added below messageEncoding="Mtom" and MaxReceivedMessageSize to the bindings, then it works
<basicHttpBinding>
<binding name="SlsServiceWSSoapBinding" messageEncoding="Mtom" maxReceivedMessageSize="2000000000">
<security mode="Transport" />
</binding>
</basicHttpBinding>
· svcutil [wsdl url] /out:references.cs /serializer:XmlSerializer
https://msdn.microsoft.com/en-us/library/aa347733%28v=vs.110%29.aspx
with below configuration for binding generated by the tool, the web service will returns an exception saying something like not expected content type
<basicHttpBinding>
<binding name="SlsServiceWSSoapBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
We added below messageEncoding="Mtom" and MaxReceivedMessageSize to the bindings, then it works
<basicHttpBinding>
<binding name="SlsServiceWSSoapBinding" messageEncoding="Mtom" maxReceivedMessageSize="2000000000">
<security mode="Transport" />
</binding>
</basicHttpBinding>
相关文章推荐
- HTML5-websocket(构建高性能的实时web应用)
- jQuery插件 -- Form表单插件jquery.form.js
- 关于使用colorbox加载html页面的一些问题
- 10个免费开源的JS音乐播放器插件
- System.Windows.Forms.WebBrowser中 处理 js 脚本 window.Open 禁止新建窗口 的方法
- Jquery Ajax表单提交插件jquery form用法
- 【转载】AngularJS 用$sce服务来过滤HTML标签,解决无法正确显示后台传递的html标签
- 纯CSS实现的三级导航菜单效果代码
- js小技巧
- FastJson之有道翻译
- FrameBuffer
- [LeetCode 241] Different Ways to Add Parentheses
- java中的WeakReference
- JSP 内置对象
- jquery扩展的radio和checkbox前端调用方法
- JSONP理解
- JSON快速解析(Json和FastJson对比)
- Bootstrap 模态对话框只加载一次 remote 数据的解决办法
- jquery扩展的easyui-checkbox控件
- HTML5 getUserMedia/AudioContext 打造音谱图形化