惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
博客园 - Franky
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - 司徒正美
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
博客园_首页
S
SegmentFault 最新的问题
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
H
Help Net Security
MongoDB | Blog
MongoDB | Blog

博客园 - 蓝狐

Java Been, EJB, POJO 之间的区别 Tomcat启动报错Invalid character found in method name. HTTP method names must be tokens Eclipse中Tomcat Server启动后马上又自动停止报错Address已经使用8005端口 Can't assign requested address (Bind failed) Eclipse中Tomcat的配置及简单例子 jsp页面都放在web-inf下面说是要防止用户直接访问jsp页面,为么不能直接访问jsp CATS patch on 20130513 SharePoint 2010 根据不同的用户权限显示不同的导航 vs2010 调试dll文件的方法 sharepoint 2010 打开网站导航管理页面,实现多级菜单 sharepoint 2010中备份和还原的方法 SharePoint2010多级导航配置(转) C# SerialPort System.ObjectDisposedException, safe handle has been closed 解决方案 说说大型高并发高负载网站的系统架构 (转) 大型网站的架构设计问题----大型高并发高负载网站的系统架构(转) 动态创建类型及属性--转 - 蓝狐 - 博客园 sql 行专列 列转行 普通行列转换 ajaxpro总是运行时语法错误--如何进行JS脚本调试 手动生成WebService代理类的简单办法 (摘) - 蓝狐 - 博客园 由WSDL文件生成WEB service server端C#程序 (摘)
(原创)Sharepoint webpart中调用web service报错
蓝狐 · 2012-11-20 · via 博客园 - 蓝狐

在Sharepoint webpart中调用web service时报错

错误信息:在 ServiceModel
客户端配置部分中,找不到引用协定“PMADMWebService.PmAdmWebServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。

这是因为调用用web service的站点的web.config 中没有添加service mode 配置, 添加相关配置并重启sharepoint 站点。

在webpart工程总添加webservice引用时会在你的web part的配置文件中生成相关配置信息如下,copy整个servicemode配置节即可。

相关配置信息如下示例:

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicDataWebServiceSoap" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
                <binding name="PmAdmWebServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                    bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost/BasicWebService.asmx"
                binding="basicHttpBinding" bindingConfiguration="BasicDataWebServiceSoap"
                contract="BasicDataWebService.BasicDataWebServiceSoap" name="BasicDataWebServiceSoap" />
            <endpoint address="http://localhost:8090/PmAdmWebService.asmx"
                binding="basicHttpBinding" bindingConfiguration="PmAdmWebServiceSoap"
                contract="PMADMWebService.PmAdmWebServiceSoap" name="PmAdmWebServiceSoap" />
        </client>
    </system.serviceModel>