I've got an application that communicates with a wndows service via .net remoting.
Under XP this is all fine but when I run the same code on Vista I get the exception
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8969
Server stack trace:
at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(AddressFamily family)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
I've tried turning the firewall off, running the service in the same user context as the user that is logged in to no avail.
Is there something about Vista that doesn't allow communication between services and user applications via .net remoting?
Has anyone else seen this?
I never came up with a resolution for this. But instead of using tcp for remoting, I used the ipc protocol that came with .net 2.0 (this was a converted project from 1.1).
Specifying the authorized group got around this issue:
<system.runtime.remoting>
<application name="MyService">
<service>
<wellknown type="MyAssembly.MyServiceProxy, MyService" objectUri="FrontdeskSyncService.rem" mode="Singleton" />
</service>
<channels>
<channel ref="ipc" portName="server" authorizedGroup="Everyone">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
Related
I had came across this scenario's for all the below use cases.
Except Case 3 which is normal & general and rest of the cases needs to be resolved
These below Services were running without any errors:
Net.Msmq Listener Adapter
Net.Pipe Listener Adapter
Net.Tcp Listener Adapter
Net.Tcp Port Sharing Service
Windows Process Activation Service
also Enabled Protocols: net.tcp,http
From the command line or via application when calling WCF written services:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools>svcutil net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex
Case 1:
Could not connect to
net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex. The
connection attempt lasted for a time span of 00:00:04.0935290. 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
Case 2:
There was no endpoint listening at
net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex that
could accept the message. This is often caused by an incorrect address
or SOAP action. See InnerException, if present, for more details.
Case 3:
The socket connection was aborted. This could be caused by an error
processing your message or a receive timeout being exceeded by the
remote host, or an underlying network resource issue. Local socket
timeout was '00:04:59.9843875'.
An existing connection was forcibly closed by the remote host
Event Log for Case 2:
An error occurred in the Activation Service 'NetTcpActivator' of the protocol 'net.tcp' while trying to listen for the site '1', thus the protocol is disabled for the site temporarily. See the exception message for more details.
URL: WeakWildcard:net.tcp://username.domainname.com/
Status: FailedToListen
Exception: System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at System.ServiceModel.Channels.SocketConnectionListener.Listen()
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.SocketConnectionListener.Listen()
at System.ServiceModel.Activation.TransportListener.Go(IConnectionListener connectionListener)
at System.ServiceModel.Activation.TransportListener..ctor(IPEndPoint endPoint)
at System.ServiceModel.Activation.TransportListener.Listen(IPEndPoint endPoint)
at System.ServiceModel.Activation.RoutingTable.TcpStart(MessageQueue messageQueue, BaseUriWithWildcard path)
at System.ServiceModel.Activation.MessageQueue.Register(BaseUriWithWildcard path)
at System.ServiceModel.Activation.ListenerAdapter.RegisterBindings(IActivatedMessageQueue queue, Int32 siteId, String[] bindings, String path)
Process Name: SMSvcHost
Process ID: 4608
How should we need to achieve to go to case 3 by default, whenever, at times such as Booting and rebooting the system?
Case 1 and Case 2 require a Mex service endpoint in the WCF service configuration. Please add a Mex endpoint to exchange the service metadata.
<system.serviceModel>
<services>
<service name="WcfService1.Service1">
<endpoint address="service1" binding="basicHttpBinding" contract="WcfService1.IService1" ></endpoint>
<endpoint address="service2" binding="netTcpBinding" contract="WcfService1.IService1"></endpoint>
<!--for exchanging service metadata.-->
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
</service>
</services>
Feel free to let me know if there is anything I can help with.
I'm trying to get OS authentication setup for a WCF-Custom Oracle send port in BizTalk 2013 R2. I can connect to the Oracle db using OS Auth in SQL Developer (When logged in as my BizTalk service account) and Visual Studio can use OS auth as well so I know that the account is active and has the correct permissions in the Oracle Db. Unfortunately, the BizTalk adapter throws the following exception when I try to query the database:
The adapter failed to transmit message going to send port "MySendPort" with URL "oracledb://MyTnsName". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.ConnectionException: ORA-01017: invalid username/password; logon denied ---> Oracle.DataAccess.Client.OracleException: ORA-01017: invalid username/password; logon denied
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at Microsoft.Adapters.OracleCommon.OracleCommonConnectionWrapper..ctor(String connectionString, OracleCommonExecutionHelper executionHelper)
at Microsoft.Adapters.OracleDB.OracleDBConnection.Microsoft.ServiceModel.Channels.Common.IConnection.Open(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at Microsoft.Adapters.OracleDB.OracleDBConnection.Microsoft.ServiceModel.Channels.Common.IConnection.Open(TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.ConnectionPool.GetConnection(Guid clientId, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.ConnectionPool.GetConnectionHandler[TConnectionHandler](Guid clientId, TimeSpan timeout, MetadataLookup metadataLookup, String& connectionId)
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterRequestChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Open()
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.GetChannel[TChannel](IBaseMessage bizTalkMessage, ChannelFactory`1& cachedFactory)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)".
If I change the user name from "/" to a local Oracle account and password, BizTalk can query the db just fine.
I have both the 32bit and 64bit oracle 12c clients installed with ODAC 2.121.2.0. The Oracle env variables are first in the system PATH variable and I've added a binding redirect to the Microsoft.Adapters.OracleDB.config file in BizTalk to reference the newer ODAC version.
Any help would be appreciated.
I just deployed a MVC web app to my windows server 2012. It has Windows 8 and IIS v8 installed. The application uses SignalR, and I would like to use websockets, but it gives errors.
In every browser (chrome ff, ie) the error is the same:
"NetworkError: 500 Internal Server Error - https://domain.com/signalr/connect?transport=webSockets&connectionToken=wiiR333%2BkbKu0Ex2SPZLE9W9X6eAm5lBssbjXbqCvl0QpjAiGtHkn1xiIQHYGi3O4DDLIv7whTahVb8Ll5kfwjnrzaZaDYCApWj5aWm6d1cZzxH89K%2BouHziBH7dCt9I&connectionData=%5B%7B%22name%22%3A%22charthub%22%7D%5D&tid=8"
The detailed error message would be:
Exception information:
Exception type: InvalidOperationException
Exception message: Not a valid web socket request.
at Microsoft.AspNet.SignalR.Transports.WebSocketTransport.AcceptWebSocketRequest(Func`2 callback)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I asked in the SignalR Jabbr chat what the error would be and they told me something is blocking the connections. I checked, and both TCP port 80 and port 443 are listening.
The IIS trust level is Full (internal) and we're not using loadbalancing. The Websockets protocol is installed.
What could be wrong?
I am deploying a test rig as per the directions from http://msdn.microsoft.com/en-us/library/windowsazure/hh674491.aspx with the controller and agents hosted on windows azure. I have followed all the directions properly and my VS client is able to see the controller and agents. However when i execute a load test, the test remains in an pending state and I see the below error in the Controller's eventlog. My problem is similar to one found at: http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/thread/4040619f-5667-4445-804a-84f37d823c9f/. Please help!
(QTController.exe, PID 692, Thread 11) ControllerDeployment.DoDeployment: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [xxx:xxx:xxxx:xxx:xxxx:xxxx:xxxx:220]:6915
Server stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.TestTools.Common.FileCopyService.get_DeploymentFlags()
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.b__6(FileCopyService fileCopyService)
at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer1.InvokeAsRemoteUser(Action1 invoke)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.DoDeployment()
Based on the error message it looks like the controller is not able to talk to the agent. Have you set up a connect group as mentioned below:
"http://msdn.microsoft.com/en-us/library/windowsazure/hh674497.aspx"
Creating a Connect Group
The Connect feature of Azure allows you to create a Virtual Private Network. Members of the group can include on-premise computers as well as Azure role instances. For the Load Test solution, the Connect group allows communication between the test controller and the agents.
Attempted this as well, and couldn't get it to work. Ended up having to move the Controller into Azure as well.
I followed the documentation as far as what ports the agent needed, and opened those up in the Azure firewall. However, after doing a network capture, IIRC it also used some dynamic ports that weren't going to work to open up.
So I found that I had to move Visual Studio, the Load Agent Controller, and the Load Agents themselves all into Azure to utilize this in the cloud.
When attempting to start the debugger on an otherwise perfectly functional Azure project, what can cause the following exception to occur?
System.ServiceModel.CommunicationObjectFaultedException
was unhandled Message=The
communication object,
System.ServiceModel.Channels.ServiceChannel,
cannot be used for communication
because it is in the Faulted state.
Source=mscorlib StackTrace:
Server stack trace:
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan
timeout)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Close(TimeSpan
timeout)
at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan
timeout)
at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[]
args) InnerException:
For me, the problem was that my startup project for debugging was set to the package project (i.e. the project containing the service definition files) rather than one of my web roles. (This got reset when I changed machines.) Right-clicking on a web role and selecting "Set as StartUp Project" fixed the error.
In case you don't notice the comment above, #smarx also mentions that a common cause for the same error is a read-only web.config file and points to http://msdn.microsoft.com/en-us/library/gg494981.aspx. That same link mentions a couple other related causes too.