哎,我在客服端添加代理引用时候的bing定策略定义忘修改了造成这个错。。
是的service中的配置,是不是配置了basichttpbind,但是你的配置的终结点的地址确实https开头的
你可以贴出你的配置来看看
<service behaviorConfiguration="Service.CupPayDotnet.CupPamentService"
name="Service.CupPayDotnet.CupPamentService">
<endpoint address="" binding="basicHttpBinding" contract="Service.CupPayDotnet.ICupPamentService" bindingConfiguration="myUserSafeBinding">
<identity>
<dns value="Service.CupPayDotnet.CupPamentService" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<binding name="myUserSafeBinding">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" />
</security>
</binding>
<behavior name="YaMengESB.CupPayDotnet.CupPamentService">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="None" />
</clientCertificate>
<serviceCertificate findValue="services.ymcft.com" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySubjectName" />
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="YaMengESB.UserValidator,YaMengESB" />
<issuedTokenAuthentication allowUntrustedRsaIssuers="true" />
</serviceCredentials>
</behavior>
如上配置,我设置了basichttpbind
我在serviceMetadata节点和endpoint节点的配置url方案都是https
@大灰机: 可以改回http开头吗? 不行的话,参考这个:
http://www.cnblogs.com/artech/archive/2011/06/02/Authentication_042.html
你应该是配置了baseaddresss的吧
把 bindingConfiguration="myUserSafeBinding" 这个去掉。
选中你的*.Web测试项目——》右键 选择设为启动项,——》然后将 *.aspx 设为起始页。然后再重新运行就可以查看运行结果了,今天遇到了所以记录一下,希望能对别人有所帮助