我創建了一個WCF服務。Web服務包含一個空的服務標籤
在WSDL中,我看不到服務應綁定的URL和PORT。
我看到的是:
<wsdl:service name="SimpleWebService"/>
任何想法,我究竟做錯了什麼?也許在web.config中的東西?
<system.serviceModel>
<client />
<bindings>
<webHttpBinding>
<binding closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="WS.OS.SimpleWS" behaviorConfiguration="myServiceBehavior">
<endpoint name="webHttpBinding" address="" binding="webHttpBinding" contract="WS.OS.SimpleWS" behaviorConfiguration="webHttp" />
<endpoint name="mexHttpBinding" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="myServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
你能提供你的任何代碼嗎?配置文件?其他相關的源代碼? – Haris
我用web.config更新了這篇文章 –
是否託管在IIS中(我猜是因爲你有serviceHostingEnvironment標籤)? – iMortalitySX