Using SignalR in Window Services - windows-services

I am using SignalR to broadcast messages to client browsers via window service.
It only works on <http://localhost>
<HubConnection("http://localhost/signalr")>
Change to <http://www.xyz.com> will get an error message: "One or more errors occurred".
<HubConnection("http://xyz.com/signalr")>
Are there any settings or additional library required to make it work?

You don't need any additional components, after all it already works locally.
The 'One or more errors occurred' error is returned when the connection to the remote SignalR resource was not successful.
You can use Fiddler and wFetch to troubleshoot such problems

Related

Connection to Microsoft Dynamics 365 working in console app but not in web app

I need to modify my existing code to connect to Microsoft Dynamics 365 instead of an on-premises installation. I'm currently using the Microsoft.Xrm.Tooling.Connector and we want to keep this so that the impact on the code is as low as possible.
So I have updated my connection string to use following format:
AuthType=ClientSecret;url=https://xxx.dynamics.com;ClientId=xxx;ClientSecret=xxx;
I have updated the nuget package Microsoft.CrmSdk.XrmTooling.CoreAssembly to the latest version 9.1.0.64. The other related packages were updated at the same time.
The code I use is:
var client = new CrmServiceClient(connstring);
Unfortunately this is not working in my .net 4.7.1 web.app
I get following errors:
CurrentAccessToken = 'CurrentAccessToken' threw an exception of type 'System.NullReferenceException'
LastCrmError = "One or more errors occurred. => An error occurred while sending the request. => Unable to connect to the remote server => A connection attempt failed because the connected party did not properly respond after a period of time, or established connection fai..."
I have also already tried to add following line but the error stays:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
To be sure that it's not related to my existing web app I have started a new project and I have included a new web app (mvc) and a new console app. Even in that new project the web app is not working but the console app is working.
A difference I see is that for CrmConnectOrgUriActual the console app contains XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.2156 but in the webapp this is only XRMServices/2011/Organization.svc/
Is there maybe something extra that need to be configured in the web app?
Can someone help me with this?
Update
I was able to see more of the error message and it was mentioning also following message: AuthorityUnable to connect to CRM: Need a non-empty authority
I did a new search on "Need a non-empty authority" based on the full error details.
One of the results was the following article: https://www.kashanahmed.com/2020/06/we-were-trying-to-connect-dynamics-365.html
So it seems that my issue was caused by the proxy server of our company.
Adding following lines in the web.config solved my issue
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" proxyaddress="http://theproxy" />
</defaultProxy>
</system.net>

timeout in telegram.bot webhook - asp.net mvc

I had been developed a telegram bot using Telegram.Bot.
I tried to rework with the bot, First I created bot using BotFather and got token.
I set webhook server api address in telegram api. But when I check webhookinfo it returns this error
https://api.telegram.org/botToken/getWebhookinfo
respone:
"last_error_date":1585419712,"last_error_message":"Connection timed out"
I checked it need TLS12 to have secure connection using
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
But It's not getting updates in my server and show time out error.
I tried posting using postman and ngrok to run on my iisexpress and I'm getting data and can sending messages to bot in my localhost.
But In hosting it's not working, whats wrong with new Telegram.Bot library or telegram server?
update
I checked with postman my hosting url, post man also cant connect to that url. what can be wrong with my codes?
This is response when i'm call update receiving URL in my hosting:
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 10.10.34.35:443
I got problem, the certificate which we use should be valid one, not free.
For more information please study this link:
https://core.telegram.org/bots/webhooks

MAPI_E_NETWORK_ERROR (not logged in) Redemption (using Outlook not MAPI standalone)

I have got my application working fine with the standalone MAPI (1.2.1 CDO) however after removing that and installing Outlook, I cannot get it working.
I get a MAPI_E_NETWORK_ERROR, which when I catch and return the exception message caught comes up with
System.Runtime.InteropServices.COMException: Not logged on. Please log on first
Do I have to do anything different to get this working with an outlook installation? This is thrown when doing
LogonExchangeMailbox(username, exserver)
MAPI_E_NETWORK_ERROR is a network access error. Is firewall active on that machine? Was your app added to the exclusion list?
It could also be the name of the exchange server not being correct. I had this issue as the old exchange server had been decommissioned so rather than being EXHANGE.ad.{company}.com it changed to just the new server name e.g. EXCHANGEABC12.
Also keep in mind that LogonExchangeMailbox connect using plain old RPC protocol. If you are connecting to Exchange 2013/2016 over RPC-over-HTTP, you need to use LogonHostedExchangeMailbox .

IBM Worklight Adapter Invocation is throwing UNRESPONSIVE_HOST error

I have a very simple Worklight project that has two adapters. The first is talking to LinkedIn OAuth services to return an access token. The second takes the access token and calls LinkedIn's API services. The code works beautifully in project A. Project A is a larger project and includes a bunch of other things. I took the working adapters and copied them into project B. The adapters are word for word the same. The security settings between the projects are identical. Both adapters are deployed and I can verify them on the Worklight Console. However, in project B, when i call the oauth adapter i get the access token just fine, when i turn around and call the api adapter I get an error immediately saying that the host is unresponsive. UNRESPONSE_HOST "The service is currently not available".
Here is the logcat messages:
01-16 15:42:44.298: D/LinkedIn(3101): Request [http://192.168.245.1:10080/LinkedInDevWorks/apps/services/api/LinkedIn/android/query]
01-16 15:42:44.488: E/LinkedIn(3101): [http://192.168.245.1:10080/LinkedInDevWorks/apps/services/api/LinkedIn/android/query] Host is not responsive. Try to manually access the URL through the android emulator browser to verify connectivity.
I'm running out of ideas...
I looked at this article: http://www.ibm.com/developerworks/websphere/techjournal/1212_paris/1212_paris.html on adapter error messages but the settings between the two projects are identical so it's odd that it works on one and not the other.
I am running worklight 6.0
I still haven't found a solution to this problem but I wanted to post the workaround as an answer for others facing a similar problem:
"When i call the second adapter within the success handler from the first adapter or from within the wlCommonInit() method it does NOT throw the UNRESPONSIVE_HOST error."

Reports are not accessable from one of web fron ends # Sharepoint Farm (I can send the snapshots)

We have a report server in Sharepoint Farm but when users try to connect from one of WFE, they receive HTTP 401 error but it works fine with other WFE.
We have 2 Web front ends (WFE) in the farm, PROD_MOSS01 and PROD_MOSS02. Those 2 servers are load balanced by our firewall (Forefront TMG).
A client connects to forefront, then it sends the traffic to one of the WFE, & uses the external host name. The 2 WFEs are now configured to use a new single report server, PROD_REPORT. The report service is joined to the farm, and is setup to not display web content. It was configured in SP Integrated mode, but it keeps defaulting to native mode.
If I drop the report DB and re-attach, it shows the DB is SP Integrated mode. When it attaches, it reverts back to Native.
So with this setup, only 1 WFE is able to generate reports. Initially it was PROD_MOSS01 that was working, and PROD_MOSS02 was throwing the 401 error. Now it seems to have switched which one works and which throws the error. So it looks like only 1 WFE can connect to the report sever, the other cannot.
We have the farm/report server setup to use NTLM only, but if this is a limitation of NTLM authentication, we can try & get Kerberos configured. I have not registered the SPNs for the new report sever.
Also, if you hit the server with the 401 error, you cannot configure the DM_MRCS connection string. It gives an error saying the Report server must be in SP integrated mode and attached to the farm.

Resources