2

IIS 7 を実行している開発マシンで動作する WCF サービスがありますが、同僚は IIS 5.1 (XP) を実行しています。サービス ページに移動すると、Web ブラウザーでサービスを表示できますが、Web ブラウザーで操作を呼び出したり、そこに移動しようとすると、404 エラーが発生します。

彼に ServiceModelReg -i を実行してもらいましたが、何も変わりませんでした。彼に .svc?wsdl ページに移動してもらい、そこにメソッドがリストされています。しかし、メソッド (WebGetAttribute を使用) に移動しようとすると、IIS は 404 を返します。何かアイデアはありますか?

アップデート

この問題は、彼が IIS からサイトを実行している場合にのみ発生します。彼が Visual Studio Web サーバー (cassini) を使用してプロジェクトを読み込むと、問題なく動作します。

問題はサービス自体にあるとは思いませんが、念のために次のとおりです。

    [ServiceContract]
public interface IPFDClientAuthentication {
    [OperationContract]
    [WebGet(UriTemplate="/Logon?username={username}&password={password}",
        BodyStyle=WebMessageBodyStyle.WrappedResponse,
        ResponseFormat=WebMessageFormat.Json)]
    [JSONPBehavior(callback="callback")]
    bool Logon(string username, string password);

    [OperationContract]
    [WebGet(UriTemplate = "/Logout",
        BodyStyle = WebMessageBodyStyle.WrappedResponse,
        ResponseFormat = WebMessageFormat.Json)]
    [JSONPBehavior(callback = "callback")]
    bool Logout();

    [OperationContract]
    [WebGet(UriTemplate="/GetIdentityToken",
        BodyStyle=WebMessageBodyStyle.WrappedRequest,
        ResponseFormat=WebMessageFormat.Json)]
    [JSONPBehavior(callback= "callback")]
    string GetIdentityToken();
}

web.config は次のとおりです。

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
    <service behaviorConfiguration="PFD.AuthenticationService.PFDClientAuthenticationBehavior"
                     name="PFD.AuthenticationService.PFDClientAuthentication">
        <endpoint address="" behaviorConfiguration="PFD.AuthenticationService.PFDClientEndpointBehavior"
                         binding="customBinding" bindingConfiguration="clientBinding"
                         name="clientEndpoint" contract="PFD.AuthenticationService.IPFDClientAuthentication">
            <identity>
                <dns value="localhost" />
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
</services>
<bindings>
    <customBinding>
        <binding name="clientBinding">
            <jsonpMessageEncoding/>
            <httpTransport manualAddressing="true"/>
        </binding>
    </customBinding>
</bindings>
<behaviors>
    <endpointBehaviors>
        <behavior name="PFD.AuthenticationService.PFDClientEndpointBehavior">
            <webHttp />
        </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
        <behavior name="PFD.AuthenticationService.PFDClientAuthenticationBehavior">
            <serviceMetadata httpGetEnabled="true" />
            <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
    </serviceBehaviors>
</behaviors>
<extensions>
    <bindingElementExtensions>
        <add name="jsonpMessageEncoding" type="Microsoft.Ajax.Samples.JsonpBindingExtension, 
                 PFD.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    </bindingElementExtensions>
</extensions>

4

2 に答える 2

1

XP マシンの IIS にワイルドカード マッピングを追加します。*.*C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll にマップし、[ファイルの存在を確認する] チェックボックスをオフにします 。

REST URL の形式によっては、(URL はディレクトリまたはファイルのように見えますか?).*の代わりに配置する必要がある場合があります。*.*

于 2009-07-02T17:19:35.567 に答える
0

/soapサービス URL の末尾に追加してみてください。

于 2010-03-10T18:44:27.527 に答える