我确定我错过了一些简单但却无法解决的问题。
我有一个WCF服务,我最初在web.config
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Delivery"/>
</basicHttpBinding>
</bindings>
<services>
<service name="LWS.Delivery">
<endpoint address="http://localhost/LWS/Delivery.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Delivery" name="Basic"/>
</service>
</services>
我在服务的WSDL和消费客户端的svcinfo文件中相应地获得了端点名称(Basic)和绑定配置(CustomTimeOut)的相同值。
这是WSDL中具有预期绑定和名称的部分:
<wsdl:service name="LWS.Delivery">
<wsdl:port name="Basic" binding="BasicHttpBinding_Delivery">
<soap:address location="http://localhost/LWS/Delivery.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
然后我尝试将绑定更改为以下内容,专门更改端点名称和绑定配置。
<bindings>
<basicHttpBinding>
<binding name="DeliverySoapBinding"/>
</basicHttpBinding>
</bindings>
<services>
<service name="LWS.Delivery">
<endpoint address="http://localhost/LWS/Delivery.svc" binding="basicHttpBinding" bindingConfiguration="DeliverySoapBinding" name="DeliveryImplPort"/>
</service>
</services>
但是,我仍然获得WSDL和svcinfo文件的原始名称。这就是我所期待的:
<wsdl:service name="LWS.Delivery">
<wsdl:port name="DeliveryImplPort" binding="DeliverySoapBinding">
<soap:address location="http://localhost/LWS/Delivery.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
我尝试了什么: