0

WCF サービスを作成しました。

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>
4

2 に答える 2

0

質問と構成を見て、サービスが IIS でホストされていると想定しています (それがどこにつながるかは誰もが知っています)。したがって、"" のアドレスとポートが指定されていない場合、IIS 設定を調べて、サービスが開いているサイトとポートを見つける必要があります。http のデフォルトは 80 で、https は 443 です。

簡単な例として、サービスが IIS の「既定の Web サイト」にある場合、サービスはおそらく次の場所にあります。

http://YourServer/YourService/YourService.svc

特定の異なるサイトの下にホストされている Web アプリケーションがある場合は、IIS の設定を調べてそれを見つける必要があります。また、IIS で SVC をデフォルトページとしてホストすることも一般的であるため、URI に実際のページではなく、最初の 2 つの部分のみを含めることができます。Web サーバーを掘り下げない限り、うまくいくとは思えません。

于 2012-11-16T14:36:25.707 に答える