2012-02-17 9 views
3

私は数時間Webサービスを呼び出そうとしています。 私はclientaccesspolicy.xml追加しました:私のウェブサイトのルートディレクトリにリモートサーバーがNotFoundエラーを返しました。 Silverlight + WCF

<?xml version="1.0"?> 
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> 
<cross-domain-policy> 
    <allow-http-request-headers-from domain="*" headers="SOAPAction,Content-Type"/> 
</cross-domain-policy> 

<?xml version="1.0" encoding="utf-8"?> 
<access-policy> 
    <cross-domain-access> 
    <policy> 
     <allow-from http-request-headers="*"> 
     <domain uri="*"/> 
     </allow-from> 
     <grant-to> 
     <resource path="/" include-subpaths="true"/> 
     </grant-to> 
    </policy> 
    </cross-domain-access> 
</access-policy> 

とのcrossdomain.xmlを。 WebサービスがIISから呼び出され、ここで動作します。

しかし、私は、Silverlightアプリケーションからの私のWCF Webサービスを呼び出すようにしようとしているとき、私はこのエラーを取得:NOTFOUND:

リモートサーバーがエラーを返しました。

これはフィドラーからのログです:私はエラーを取得するとき

a:InternalServiceFaultThe server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

これは、コードです:私は間違っ

public int EndUserExist(System.IAsyncResult result) { 
     object[] _args = new object[0]; 
     int _result = ((int)(base.EndInvoke("UserExist", _args, result))); //Here 
     return _result; 
      } 

何をしているのですか?

+0

エンドポイントが正しく設定されていることを確認します。 wsdlに基づいてVisual Studioで構築されたプロキシクラスを使用する場合は、正しく定義されているかどうかを確認することもできます(特に、適切なパラメータを持つUserExistメソッドが含まれている場合)。 –

答えて

0

大丈夫です; これで動作します。 web.configでデバッグをオンにしたので、Fiddlerで例外メッセージが表示されました。 SQLデータベース用にIIS上のプールにIDユーザーを設定する必要があります。

9

このテキストについては、Web.configを参照してください。IncludeExceptionDetailInFaults trueに設定します。次に、サービスリクエストを再度実行し、今度はあなたが知る必要があることを教えてくれるFiddlerを見てください。 SQLエラーからヌル参照になることがあります。 :-)

+0

さらに、sql接続でプロジェクトを作成します。このsqlConnに文字列を渡すと、問題なく開かれています... – ogrod87

0

携帯端末でWi-Fi設定にアクセスし、現在のWi-Fi接続を編集します。 プロキシを「自動的に設定を検出する」に設定します。

関連する問題