2011-12-05 28 views
1

WASのWCFサービスのホスティングに関する助けが必要です。 私はIISでサービスをホストし、basicHttpとwsHttpバインディングを介してアクセスしました。 しかし、WASでホストし、tcp/ipでアクセスしようとすると何かが恋しくなるようです。WASのホストWCFサービス

私はアプリケーションmywcfapp

、サービスはデフォルトのWebサイトで公開されているWindowsでの非HTTPのためのWCFの活性化が

機能対応ポート10000

TCP上のアクセスのためにそれを設定する必要が

私は以下のようにデフォルトのWebサイトとmywcfapp上のポート10000に結合net.tcpを有効にするには、BATファイルを作成:

%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='10000:*'] 
%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/mywcfapp" /enabledProtocols:http,net.tcp 

たちをb.configは

<services> 
    <service name="MyWcfService"> 
    <clear /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" 
     listenUriMode="Explicit" /> 

    <endpoint address="net.tcp://localhost:10000/mywcfapp/mywcfapp.svc" 
     binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="MyApp.IService" /> 
    <endpoint address="net.tcp://localhost:10000/mywcfapp/mywcfapp.svc" 
     binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="MyApp.IService" /> 

    </service> 
</services> 

<bindings> 
    <netTcpBinding> 
    <binding name="PortSharingBinding" portSharingEnabled="true"> 
     <security mode="None" /> 
    </binding> 
    </netTcpBinding> 
</bindings> 

ですが、サービスにアクセスできないと思われます。

私はURI

net.tcp://localhost:10000/mywcfapp/mywcfapp.svc/mex 

でWcfTestClientでサービスにアクセスしようとすると、私はURL(W/O指定ポート)に接続しようとすると、私は次のようなエラー

<Fault xmlns="http://www.w3.org/2003/05/soap-envelope"> 
<Code> 
    <Value>Sender</Value> 
    <Subcode><Value xmlns:a="http://www.w3.org/2005/08/addressing">a:DestinationUnreachable</Value> 
    </Subcode> 
</Code> 
<Reason><Text xml:lang="ro-RO"> 
    The message with To 'net.tcp://localhost:10000/mywcfapp/mywcfapp.svc/mex' 
    cannot be processed at the receiver, due to an AddressFilter mismatch 
    at the EndpointDispatcher. 
    Check that the sender and receiver's EndpointAddresses agree. 
</Text></Reason> 
</Fault> 

を得る

net.tcp://localhost/OneTest.Service/OneTest.Service.svc/mex 

エラーが発生します(重要な部分のみ保持されます)

Could not connect to net.tcp://localhost/mywcfapp/mywcfapp.svc/mex. 
The connection attempt lasted for a time span of 00:00:02.0041146. 
TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:808.  
No connection could be made because the target machine actively refused it 127.0.0.1:808 

答えて

3

これは役立つかもしれない:IISマネージャへ

ゴー。 アプリを右クリックします。 [アプリケーションの管理] - > [詳細設定]を選択します。 動作では、[有効なプロトコル]のフィールドがあります。

、それだけでhttpを持っている場合、それはnet.tcp

を持っていることを確認してください

http,net.tcp 
+0

に変更するおかげで、私は(私はBATを実行したとき、私はそれを有効に推測)をチェックし、そのは、すでに有効になっていました。しかし、問題はポートのどこかにあると思われます。奇妙なのは、WCFテストクライアントでURIにポート(10000)を含めると、EndpointDispatcherでAddressFilterが一致しないというエラーです。 URIにポートを含めないと、クライアントはポート808のサーバーに接続しようとしているようですが、なぜですか? – bzamfir

+0

httpとnet.tcpの間にカンマだけのスペースがないことを確認してください。 – Tim

関連する問題