Unable to establish Web Stream - Service Bus Example
I'm trying to run all the service bus examples, in my office we behind the firewall and proxy. So, I'm using the below code to avoid the error "Unable to reach servicebus.windows.net via TCP (818, 828) or HTTP (80, 443)"
<system.net>
<defaultProxy useDefaultCredentials="true">
</defaultProxy>
</system.net>
But still I'm getting the below error if I use any other binding other than "netOnewayRelayBinding". Please suggest me how to run other examples without getting the below error. If I'm using "netOnewayRelayBinding" the service is running fine.
System.ServiceModel.CommunicationException was unhandled
Message="Unable to establish Web Stream"
Source="Microsoft.ServiceBus"
StackTrace:
at Microsoft.ServiceBus.RelayedOnewayTcpClient.Connect()
at Microsoft.ServiceBus.RelayedOnewayTcpClient.EnsureChannel()
at Microsoft.ServiceBus.RelayedOnewayTcpClient.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout)
at Microsoft.ServiceBus.RelayedOnewayTcpListener.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.RefcountedCommunicationObject.Open(TimeSpan timeout)
at Microsoft.ServiceBus.RelayedOnewayChannelListener.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at Microsoft.ServiceBus.WebSocketRelayedConnectionListener.Open(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.BufferedConnectionListener.Open(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.ConnectionAcceptor.Open(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.ConnectionDemuxer.StartDemuxing(TimeSpan timeout, OnViaDelegate viaDelegate)
at Microsoft.ServiceBus.SocketConnectionTransportManager.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.TransportManager.Open(TimeSpan timeout, TransportChannelListener channelListener)
at Microsoft.ServiceBus.Channels.TransportManagerContainer.Open(TimeSpan timeout, SelectTransportManagersCallback selectTransportManagerCallback)
at Microsoft.ServiceBus.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.SocketConnectionChannelListener`2.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.LayeredChannelListener`1.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at Microsoft.ServiceBus.Samples.Program.Main(String[] args) in C:\Program Files\Microsoft .NET Services SDK (March 2009 CTP)\Samples\ServiceBus\ExploringFeatures\Bindings\WSHttp\TransportSec\CS35\Service\Program.cs:line 28
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.ServiceModel.CommunicationException
Message="Unable to connect to factory endpoint"
Source="Microsoft.ServiceBus"
StackTrace:
at Microsoft.ServiceBus.WebStream.CreateSession(Uri factoryEndpointUri, String role, Uri& endpointLocation1, Uri& endpointLocation2)
at Microsoft.ServiceBus.WebStream..ctor(Uri factoryEndpointUri, String role)
InnerException: System.Net.WebException
Message="The remote server returned an error: (404) Not Found."
Source="System"
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.ServiceBus.WebStream.CreateSession(Uri factoryEndpointUri, String role, Uri& endpointLocation1, Uri& endpointLocation2)
InnerException:
Please help.
Murty Eranki
All Replies
- Hi
I am also facing this error. I am using NetEventRelaybinding.
But it is intermittent.
Prashant. Thanks Prashant for confirming this. Interestingly I'm not getting this error when I'm running the samples from Home Broadband. Need help to get away this problem in Office.
Murty ErankiHi Murty,
Could you try modifying your config file in the following way to discard any AutoProxy configuration issues?
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy bypassonlocal="True" proxyaddress="http://your_proxy_server:80" />
</defaultProxy>
</system.net>
SDET LeadHi Cesar,
Thanks for your advice, I tried with this code for all the bindings from my office environment. With this extra line of code "<proxy bypassonlocal="True" proxyaddress=http://my_office_proxy_server_IP:80 />" now I'm not getting either an error or any response just the program is not terminating at all.
With regards to netOneway either I use the above line or not the program is working. Need something to be solved here?
Thanks
Murty Eranki- Hi Cesar,
Even I am facing the same problem while using netTcpRelayBinding, through corporate fire wall, at home it works just fine.
Let me know if anybody found solution to this.
Thanks,
Subrat - Hello,
Eveen i am facing the same problem with netTcpRelayBinding. Has anyone solved the issue? Any pointers in this direction would be really helpful...
Thanks and Regards
Jayesh
Jayesh


