C# Web服务创建实例问题->;找不到引用约定的默认终结点元素';MyWebService.ClassName';
我想使用以下Web服务:C# Web服务创建实例问题->;找不到引用约定的默认终结点元素';MyWebService.ClassName';,c#,asp.net,web-services,class,C#,Asp.net,Web Services,Class,我想使用以下Web服务: PaymentIFClient pic = new PaymentIFClient(); double pic_result = pic.verifyTransaction(str1, str2); 并在添加后生成配置文件-> <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bind
PaymentIFClient pic = new PaymentIFClient();
double pic_result = pic.verifyTransaction(str1, str2);
并在添加后生成配置文件->
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="PaymentIFBinding" 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="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="PaymentIFBinding1" 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="https://acquirer.sb24.com:443/ref-payment/ws/ReferencePayment"
binding="basicHttpBinding" bindingConfiguration="PaymentIFBinding"
contract="SB24Service.PaymentIF" name="PaymentIFPort" />
</client>
</system.serviceModel>
</configuration>
但第一行抛出以下错误:
找不到引用协定的默认终结点元素
ServiceModel客户端配置中的“SB24Service.PaymentIF”
节。这可能是因为找不到的配置文件
您的应用程序,或者因为没有与此匹配的端点元素
可以在客户机元素中找到合同
编辑:
“如果在类中调用服务,则可能会出现此错误
并从另一个项目调用类库。“->My
情况是这样的
我应该如何更改配置文件?提前感谢手工编辑wcf配置是一件棘手的事情,因为有许多部分需要相互正确引用。尝试在中打开app.config文件(也可从Viusal Studio的“工具”菜单中获得)。当有GUI帮助时,更容易纠正问题。可能重复感谢评论和回答/非常好的GUI…/但是我应该换哪一部分呢?为什么默认设置有问题?