2014-12-02 73 views
0

我遇到了一個奇怪的問題,wcf服務然後在VS2013上運行在http上的調試模式生成鏈接和wsdl通過https在不同的端口上運行。
enter image description hereVS2013生成wsdl作爲https與失敗證書爲http wcf服務,然後無法生成客戶端與svcutil.exe

如果我嘗試去http://localhost:53769/WebPricingService.svc?wsdl它運行幾分鐘,最終失敗。

我不關心這個,但它失敗時,我嘗試用下面的信息來生成與svcutil.exe客戶 enter image description here

我已經mex添加到配置

<service behaviorConfiguration="wsServiceBehavior" name="Corp.WebServices.WebPricingService"> 
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsEndpointBinding" name="ConveyancingEndpoint" contract="Corp.Core.Interfaces.IWebPricingService"/> 
    <endpoint address="mex" 
       binding="mexHttpBinding" 
       contract="IMetadataExchange" /> 
    </service> 

結合

<binding name="wsEndpointBinding" maxBufferPoolSize="2147483647" 
     maxReceivedMessageSize="2147483647"> 
     <readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
     maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     <security mode="Transport"> 
     <transport clientCredentialType="Windows" /> 
     </security> 
    </binding> 

爲什麼運行wsdl on不同的端口和協議?是否有一個簡單的解決方法來生成客戶端?

回答

0

解決了我自己。

部分我問爲什麼它運行的不同端口只是簡單地說 - 我是愚蠢的。 http和https不能同時在同一端口上運行。

生成客戶去http://localhost:53769/WebPricingService.svc?singleWsdl然後在瀏覽器File -> Save As...,並將其保存在C:/作爲someName.wsdl然後打開VS工具和運行svcutil.exe c:\someName.wsdl這應該讓你被點名someName.cs客戶端在某些目錄對我來說這C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64