Connection to Microsoft Dynamics 365 working in console app but not in web app - asp.net-mvc

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>

Related

Connecting using SnowSQL denied 403 error

I am trying to configure JDBC but kept getting the same error I am getting using snowsql:
250001 (08001): Failed to connect to DB. Verify the account name is correct: JG3409.canada-central.azure.snowflakecomputing.com:443. 000403: 403: HTTP 403: Forbidden
If the error message is unclear, enable logging using -o log_level=DEBUG and see the log to find out the cause. Contact support for further help.
Goodbye!
I have configured the config file, and I have double checked the account, company, region, reset password to only use alphanumeric.
I have used both forms of the URL
The only possibility is that I am using a trial account, but I can't imagine that this would limit external non-browser connections?
I use a simple user/password, I have whitelisted my IP and I don't have a problem with a proxy or a firewall. I can successfully connect using a browser.. using:
https://app.snowflake.com/canada-central.azure/jg63409
Important contents of the config file:
[connections]
accountname=JG3409
#accountname=uegxydq-pz20606
region=canada-central.azure
username=ASHSNOWFLAKE
any ideas?
Your account is not JG3409 but JG63409 based on this link:
https://app.snowflake.com/canada-central.azure/jg63409
Try in your browser:
https://jg63409.canada-central.azure.snowflakecomputing.com
I found out using snowcd that my computer could not connect via my home router.
When I used my personal hotspot on my (5G) phone, snowcd passed all the tests immediately. The problem then arose how to adjust the network security policy to allow a CIDR block of network addresses through since my phone uses a new address every time I connect, and I can't edit the policy to allow my phone while connected via my phone (for obvious reasons)
Catch 22
123.45.0.0/16 is not accepted in the new Snowflake UI, and 0.0.0.0 doesn't work for me, but the documentation gave me a clue.. the new UI doesn't separate by commas, so I switched to the old UI and voila!
Incidentally the OLD UI uses the same URL as SnowSQL so I picked up my error in my account number there as well (although I should have seen it earlier).
Diabolical but thanks #Sergiu too!

Error connecting to Quickbooks Desktop POS through the web connector

I have a client that needs to connect his website to the Quickbooks Desktop POS 18.0. I Downloaded the Quickbooks webconnector, but the latest version gives an error and says I need quickbooks 2015 or later, so I downloaded the 2.1.0.30 version and was able to install it on the machine.
I then used the following php application https://github.com/consolibyte/quickbooks-php. I installed it on my server, got the ssl certificate and everything needed for security. I'm only using it for tests now, but the problem is that when I generate the .qwc file and use it on the web connector I get the following error: Error QBWC1048: QuickBooks Web Connector Could not verify the web application server certificate.
The domain I use is https://filcp.com/
Here is the certificate for the server
This is how my qwc file looks like
<?xml version="1.0"?>
<QBWCXML>
<AppName>My QuickBooks SOAP Server</AppName>
<AppID></AppID>
<AppURL>https://filcp.com/QuickBooks/SOAP/Server.php</AppURL>
<AppDescription>An example QuickBooks SOAP Server</AppDescription>
<AppSupport>https://filcp.com</AppSupport>
<UserName>userName</UserName>
<OwnerID>{57F3JK78-86F1-4FCC-B1FF-9H64VB813D20}</OwnerID>
<FileID>{57F3JK78-86F1-4FCC-B1FF-9H64VB813D20}</FileID>
<QBType>QBPOS</QBType>
<Notify>false</Notify>
<Scheduler>
<RunEveryNMinutes>10</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>false</IsReadOnly>
</QBWCXML>
I followed many tutorials about configuring ie and all, but nothing has worked so far. I can access the application through ie, but I still get that error on the web connector.
Can someone help me to figure out what may be causing it and if there is any other way that I can connect the client's website to Quickbooks POS?
If you visit the URL you're referencing in the .QWC file:
https://filcp.com/QuickBooks/SOAP/Server.php
You can clearly see that you're getting back a response of:
500 Internal Server Error
Your code is broken. Fix your code. If you need further hope, post your code so we can help you. Also, post your logs from the Web Connector (hit the View Log button).

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 .

Error when adding the consumer application. An application with the same name already exists

I'm using WSO2 Identity Server version 5.0.
I’m following this tutorial: https://docs.wso2.com/display/IS500/Configuring+Inbound+Authentication+for+a+Service+Provider#ConfiguringInboundAuthenticationforaServiceProvider-ConfiguringOAuth/OpenIDConnect
But every time I try to add an application in the “OAuth/OpenID Connect Configuration” under “Inboud Authentication Configuration” during the SP configuration, WSO2 gives me this error:
“Error when adding the consumer application. An application with the same name already exists.”
I really doesn’t understand which application refers because this is my first configuration on a fresh installation of WSO2 IS.
Let me know if I can attach more info/file to help finding the solution

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."

Resources