Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - problem with Duplex System using wsDualHttpBinding

 
 
Old 02-07-2007   #1 (permalink)
Sebastian Dau


 
 

problem with Duplex System using wsDualHttpBinding

Hello News Group,

I'm playing with WCF and was able to build a properly working Duplex system
using netTcpBinding.
However, when changing the configuration to wsDualHttpBinding I get an error
message on the host side when trying
to call back the client proxy:

ProtocolException {"The remote server returned an unexpected response: (400)
Bad Request."}
->InnerException: WebException{"The remote server returned an error: (400)
Bad Request."}

Getting the client proxy reference works fine with:

_client =
OperationContext.Current.GetCallbackChannel<ISpectralServiceCallbackContract>();

calling

_client.SomeOperation();

wails with the upper exception.

My Host Config File (Done with Service Conf. Editor) looks like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="NewBehavior" />
</endpointBehaviors>
<serviceBehaviors>
<behavior name="publicateBH">
<serviceMetadata httpGetEnabled="true"
httpGetUrl="http://localhost/mex" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="publicateBH"
name="WCFServices.SpectralService">
<endpoint address="net.tcp://localhost/SpectralService"
binding="netTcpBinding"
bindingConfiguration="" name="tcp"
contract="WCFServices.ISectralService" />
<endpoint address="http://localhost:249/SpectralService"
binding="wsDualHttpBinding"
bindingConfiguration="" name="wshttp"
contract="WCFServices.ISectralService" />
<endpoint address="net.pipe://localhost/SpectralService"
binding="netNamedPipeBinding"
bindingConfiguration="" name="pipe"
contract="WCFServices.ISectralService" />
</service>
</services>
</system.serviceModel>
</configuration>

The client config file reads (generated with "svcutil
http://localhost/mex"):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="pipe" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false"
transferMode="Buffered"
transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"
/>
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
<netTcpBinding>
<binding name="tcp" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false"
transferMode="Buffered"
transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard"
listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536"
maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"
/>
<reliableSession ordered="true"
inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows"
protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
<wsDualHttpBinding>
<binding name="wshttp" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false"
clientBaseAddress="http://localhost:8000/Client"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"
/>
<reliableSession ordered="true"
inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost/SpectralService"
binding="netTcpBinding"
bindingConfiguration="tcp" contract="ISectralService"
name="tcp">
<identity>
<userPrincipalName value="TRACE-HOME\Sebastian Dau" />
</identity>
</endpoint>
<endpoint address="http://localhost:249/SpectralService"
binding="wsDualHttpBinding"
bindingConfiguration="wshttp" contract="ISectralService"
name="wshttp">
<identity>
<userPrincipalName value="TRACE-HOME\Sebastian Dau" />
</identity>
</endpoint>
<endpoint address="net.pipe://localhost/SpectralService"
binding="netNamedPipeBinding"
bindingConfiguration="pipe" contract="ISectralService"
name="pipe">
<identity>
<userPrincipalName value="TRACE-HOME\Sebastian Dau" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>

As I said, it works pretty well using the net.tcp channel, but it fails with
dual http.

Does anybody know what to change in order to get it to work?

Thanks in advance,

Sebastian Dau (MCTS .NET 2.0)


My System SpecsSystem Spec
Old 02-13-2007   #2 (permalink)
Sebastian Dau


 
 

Re: problem with Duplex System using wsDualHttpBinding

Just in case you might struggle yourself with it. I had to increase the
transfer buffers since I was passing large arrays.
Now it works perfect.

"Sebastian Dau" <dau@zeiss.de> wrote in message
news:Ost5V0tSHHA.5012@TK2MSFTNGP04.phx.gbl...
> Hello News Group,
>
> I'm playing with WCF and was able to build a properly working Duplex
> system using netTcpBinding.
> However, when changing the configuration to wsDualHttpBinding I get an
> error message on the host side when trying
> to call back the client proxy:
>
> ProtocolException {"The remote server returned an unexpected response:
> (400) Bad Request."}
> ->InnerException: WebException{"The remote server returned an error: (400)
> Bad Request."}
>
> Getting the client proxy reference works fine with:
>
> _client =
> OperationContext.Current.GetCallbackChannel<ISpectralServiceCallbackContract>();
>
> calling
>
> _client.SomeOperation();
>
> wails with the upper exception.
>
> My Host Config File (Done with Service Conf. Editor) looks like:
>
> <?xml version="1.0" encoding="utf-8"?>
> <configuration>
> <system.serviceModel>
> <behaviors>
> <endpointBehaviors>
> <behavior name="NewBehavior" />
> </endpointBehaviors>
> <serviceBehaviors>
> <behavior name="publicateBH">
> <serviceMetadata httpGetEnabled="true"
> httpGetUrl="http://localhost/mex" />
> </behavior>
> </serviceBehaviors>
> </behaviors>
> <services>
> <service behaviorConfiguration="publicateBH"
> name="WCFServices.SpectralService">
> <endpoint address="net.tcp://localhost/SpectralService"
> binding="netTcpBinding"
> bindingConfiguration="" name="tcp"
> contract="WCFServices.ISectralService" />
> <endpoint address="http://localhost:249/SpectralService"
> binding="wsDualHttpBinding"
> bindingConfiguration="" name="wshttp"
> contract="WCFServices.ISectralService" />
> <endpoint address="net.pipe://localhost/SpectralService"
> binding="netNamedPipeBinding"
> bindingConfiguration="" name="pipe"
> contract="WCFServices.ISectralService" />
> </service>
> </services>
> </system.serviceModel>
> </configuration>
>
> The client config file reads (generated with "svcutil
> http://localhost/mex"):
>
> <?xml version="1.0" encoding="utf-8"?>
> <configuration>
> <system.serviceModel>
> <bindings>
> <netNamedPipeBinding>
> <binding name="pipe" closeTimeout="00:01:00"
> openTimeout="00:01:00"
> receiveTimeout="00:10:00" sendTimeout="00:01:00"
> transactionFlow="false"
> transferMode="Buffered"
> transactionProtocol="OleTransactions"
> hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288"
> maxBufferSize="65536" maxConnections="10"
> maxReceivedMessageSize="65536">
> <readerQuotas maxDepth="32"
> maxStringContentLength="8192" maxArrayLength="16384"
> maxBytesPerRead="4096"
> maxNameTableCharCount="16384" />
> <security mode="Transport">
> <transport protectionLevel="EncryptAndSign" />
> </security>
> </binding>
> </netNamedPipeBinding>
> <netTcpBinding>
> <binding name="tcp" closeTimeout="00:01:00"
> openTimeout="00:01:00"
> receiveTimeout="00:10:00" sendTimeout="00:01:00"
> transactionFlow="false"
> transferMode="Buffered"
> transactionProtocol="OleTransactions"
> hostNameComparisonMode="StrongWildcard"
> listenBacklog="10"
> maxBufferPoolSize="524288" maxBufferSize="65536"
> maxConnections="10"
> maxReceivedMessageSize="65536">
> <readerQuotas maxDepth="32"
> maxStringContentLength="8192" maxArrayLength="16384"
> maxBytesPerRead="4096"
> maxNameTableCharCount="16384" />
> <reliableSession ordered="true"
> inactivityTimeout="00:10:00"
> enabled="false" />
> <security mode="Transport">
> <transport clientCredentialType="Windows"
> protectionLevel="EncryptAndSign" />
> <message clientCredentialType="Windows" />
> </security>
> </binding>
> </netTcpBinding>
> <wsDualHttpBinding>
> <binding name="wshttp" closeTimeout="00:01:00"
> openTimeout="00:01:00"
> receiveTimeout="00:10:00" sendTimeout="00:01:00"
> bypassProxyOnLocal="false"
> clientBaseAddress="http://localhost:8000/Client"
> transactionFlow="false"
> hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288"
> maxReceivedMessageSize="65536" messageEncoding="Text"
> textEncoding="utf-8"
> useDefaultWebProxy="true">
> <readerQuotas maxDepth="32"
> maxStringContentLength="8192" maxArrayLength="16384"
> maxBytesPerRead="4096"
> maxNameTableCharCount="16384" />
> <reliableSession ordered="true"
> inactivityTimeout="00:10:00" />
> <security mode="Message">
> <message clientCredentialType="Windows"
> negotiateServiceCredential="true"
> algorithmSuite="Default" />
> </security>
> </binding>
> </wsDualHttpBinding>
> </bindings>
> <client>
> <endpoint address="net.tcp://localhost/SpectralService"
> binding="netTcpBinding"
> bindingConfiguration="tcp" contract="ISectralService"
> name="tcp">
> <identity>
> <userPrincipalName value="TRACE-HOME\Sebastian Dau" />
> </identity>
> </endpoint>
> <endpoint address="http://localhost:249/SpectralService"
> binding="wsDualHttpBinding"
> bindingConfiguration="wshttp" contract="ISectralService"
> name="wshttp">
> <identity>
> <userPrincipalName value="TRACE-HOME\Sebastian Dau" />
> </identity>
> </endpoint>
> <endpoint address="net.pipe://localhost/SpectralService"
> binding="netNamedPipeBinding"
> bindingConfiguration="pipe" contract="ISectralService"
> name="pipe">
> <identity>
> <userPrincipalName value="TRACE-HOME\Sebastian Dau" />
> </identity>
> </endpoint>
> </client>
> </system.serviceModel>
> </configuration>
>
> As I said, it works pretty well using the net.tcp channel, but it fails
> with dual http.
>
> Does anybody know what to change in order to get it to work?
>
> Thanks in advance,
>
> Sebastian Dau (MCTS .NET 2.0)


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
WCF Remote Client Callbacks using wsDualHttpBinding .NET General
Problems with wsDualHttpBinding in duplex scenario VB Script
HP6980 will not Automatically do Duplex with Duplex Hardware Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46