简体   繁体   English

在ServiceModel客户端配置部分中找不到名称为``and contract''的终结点元素

[英]Could not find endpoint element with name '' and contract '' in the ServiceModel client configuration section

I have tried days to solve this damn error. 我已经尝试了几天来解决该死的错误。 I am calling the same service in asp.net and it works fine, but when I call it in a sharepoint solution it does not work. 我在asp.net中调用了相同的服务,并且运行正常,但是在共享点解决方案中调用它时,它不起作用。 This is the error that I receive. 这是我收到的错误。

Could not find endpoint element with name 'WeatherSoap' and contract 'WeatherService.WeatherSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

this is my app.config in the library: 这是我在库中的app.config:

<configuration>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="WeatherSoap" 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>
        <customBinding>
            <binding name="WeatherSoap12">
                <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                    messageVersion="Soap12" writeEncoding="utf-8">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                </textMessageEncoding>
                <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
                    maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
                    bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
                    keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
                    realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
                    useDefaultWebProxy="true" />
            </binding>
        </customBinding>
    </bindings>
    <client>
        <endpoint address="http://wsf.cdyne.com/WeatherWS/Weather.asmx"
            binding="basicHttpBinding" bindingConfiguration="WeatherSoap"
            contract="WeatherService.WeatherSoap" name="WeatherSoap" />
        <endpoint address="http://wsf.cdyne.com/WeatherWS/Weather.asmx"
            binding="customBinding" bindingConfiguration="WeatherSoap12"
            contract="WeatherService.WeatherSoap" name="WeatherSoap12" />
    </client>
</system.serviceModel>

This is my C# code 这是我的C#代码

WeatherService.WeatherSoapClient client = new WeatherService.WeatherSoapClient("WeatherSoap");
 WeatherService.WeatherReturn result = client.GetCityWeatherByZIP(txtZip.Text);

this is the code that I use in code behind in both sharepoint visual web part and in asp.net web page. 这是我在sharepoint可视Web部件和asp.net网页中后面的代码中使用的代码。 The strange thing is that it works fine in asp.net but not in sharepoint. 奇怪的是,它在asp.net中可以正常工作,但在sharepoint中却不能。 I'm calling the service in a same project. 我在同一项目中调用该服务。

Look at this link: http://msdn.microsoft.com/en-us/library/ff647110.aspx 查看此链接: http : //msdn.microsoft.com/zh-cn/library/ff647110.aspx

You may need to add configure the wcf endpoint programmatically for the sharepoint web part. 您可能需要以编程方式为共享点Web部件添加配置wcf端点。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 ServiceModel 客户端配置部分中找不到名称为“xxxxx”且合同为“yyy”的端点元素 - Could not find endpoint element with name 'xxxxx' and contract 'yyy' in the ServiceModel client configuration section 在ServiceModel客户端配置部分中找不到引用合同的默认端点元素。 - Could not find default endpoint element that references contract… in the ServiceModel client configuration section 无法在ServiceModel客户端配置部分中找到引用合同“IAuthenticationService”的默认端点元素 - Could not find default endpoint element that references contract 'IAuthenticationService' in the ServiceModel client configuration section 在ServiceModel客户端配置部分中找不到引用contract的默认终结点元素。 - Could not find default endpoint element that references contract.in the ServiceModel client configuration section 无法找到名称和合同的端点元素 - Could not find endpoint element with name and contract C#-找不到名称为“ XXXXXX”和合同的终结点元素 - C# - Could not find endpoint element with name 'XXXXXX' and contract 找不到引用合同的默认端点元素 - Could not find default endpoint element that references contract 找不到引用合同的默认端点元素? - Could not find default endpoint element that references contract? “找不到引用合同的默认端点元素” - “Could not find default endpoint element that references contract” 找不到引用合同的默认端点元素 - Could not find default endpoint element that references contract
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM