Exchange 2010 API - Connect to company email - c#

I'm new to using the Exchange 2010 API (C#). I'm just going through a basic example (link below), but I'm having issues when using the FindItems method. In particular, I get the error "ServiceVersionException unhandled". The first thing that comes to mind is that I've specified the wrong Exchange version, like in this line:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
I've tried the different permutations though (and the IT guys tell me its 2010), and still getting the same error. I was wondering if it could be some weird firewall thing, or something else.
Any thoughts are much appreciated!
Thanks
Example: http://omegacoder.com/?p=454
EDIT: The inner exception is: "null".

Related

MS CRM An unsecured or incorrectly secured fault was received from the other party

I'm currently learning Extending Microsoft Dynamics CRM Online and On Premise Course provided by Microsoft.
I'm simply following the steps according to this lab documentation. The code should be perfectly working but it doesn't work for me.
Connection Strings:
<connectionStrings>
<add name="CRMOnline"
connectionString=
"Url=https://xxxxxx.api.crm5.dynamics.com/XRMServices/2011/Organization.svc;
Username=xxxxxx#damnits.onmicrosoft.com;
Password=xxxxxx;"/>
</connectionStrings>
The connection :
CrmConnection con = new CrmConnection("CRMOnline");
IOrganizationService service = new OrganizationService(con);
WhoAmIRequest req = new WhoAmIRequest();
var result = service.Execute(req) as WhoAmIResponse;
if (result != null)
{
Console.WriteLine(String.Format("Organization ID: {0}\nBusiness Unit ID: {1}\nuser ID:{2}", result.OrganizationId, result.BusinessUnitId, result.UserId));
Console.ReadLine();
}
The exception is caught in this line :
var result = service.Execute(req) as WhoAmIResponse;
Innerexception said "Invalid Request".
I have made sure the credentials on connectionStrings are correct multiple times
I think I have already synchronized the date & time for my pc and the CRM (synchronized internet time & selected the correct time zone on both PC & CRM. Even tested created a record & checked date&time created is correct.)
What else could cause this error?
Thank You.
Hopefully this helps someone else, I was fighting with this same error for a good while today as well.
Turns out I was using an older version of the Microsoft.CrmSdk.CoreAssemblies nuget package(7.1.1 in one project and 8.0.0 in another) as soon as I updated it to the latest (8.2.0.2) I was able to successfully connect to CRM Online.
The error "An unsecured or incorrectly secured fault was received from the other party" usually means that the password is incorrect, but it can also occur if the time between the application and the CRM server is more than 5 minutes apart. I have seen this happen when an application is deployed to a virtual server and the VM experiences "time drift" - it might work at some point, but the VM may slowly get out of sync with internet time and then run into issues authenticating.
From this forum thread

Paypal Sandbox (express-checkout) return internal error

since yesterday evening i've a problem with my "express-checkout API"
Every time if I called the uri
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-0W349......
I get the error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#paypal.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Yesterday in the morning everything was ok and since I didn't change anything also nothing on the API class.
My Server support the sha256 and the protocol Tls12.
I've nothing in the Logfile from server.
The Live environment works fine but the sandbox environment doesn't work since yesterday.
Is it an error on paypal site or on my side?
I've send also a mail to paypal but I get an autoresponse Message.
Please help me and sry for my bad english.
Thanks and best regards.
This may be related to the recent sandbox downtime over the past 24 hours or so. The problem was diagnosed by the team and they were able to repair the problem. Can you check again to see if it's working now please?

C# EWS Exchange API => sometimes work

I've seen loads post on this forum about exchange API, but I've never found something like I have.
I' m trying to connect to Exchange using Exchange API in order to get all room's meetings.
My problem : Sometimes, it's working, I can connect and get all my informations. And 5m later, impossible to connect. I got Unauthorized.
It's not an error on code because it's working, I think it's a problem with exchange server, but I really don't know what it is...
On the next picture, there are traces.
On the left, when it's working, And the same 30m later (same identification, same room) which is not working.
http://hpics.li/2d9b216
If you have any ideas ? I really don't know what to do.
thanks (and sorry for my english !)
I notice that the working request comes from server A (look at the value of X-FEServer header), and the failing one comes from server B. Perhaps there is a configuration problem on server B.
thx for this.
I've done some tests : I've modified my host file in my computer. when the url is pointing to serveur A, it's working. When it's on the other server, not working. It's the same configuration on both, cannot find what's wrong. So I will conserve my actual host file (pointing always on serveur A).

Jabber-net client suddenly stopped working

I have a very simple Jabber client, which connects to Google Talk via our "Google Apps" domain account. The connect code is as simple as it gets:
jc.User = "chatbot#ourdomain.com";
jc.Server = "ourdomain.com";
jc.Password = "password";
jc.OnMessage += new MessageHandler(jc_OnMessage);
jc.OnDisconnect += jc_OnDisconnect;
jc.OnConnect += jc_OnConnect;
jc.Connect();
This has been running fine for a couple of years, but today it's suddenly stopped working: after the Connect(), I get the exception
A first chance exception of type 'netlib.Dns.DnsException' occurred in
netlib.Dns.dll
Additional information: DNS query fails
followed by
A first chance exception of type 'System.FormatException' occurred in
System.dll
Additional information: An invalid IP address was specified.
I know that Google have indicated that XMPP support is perhaps going away, but I can still connect to the account in question using a "proper" XMPP client.
I've tried changing the Server property to different settings, including:
xmpp-server.l.google.com
alt1.xmpp-server.l.google.com
talk.google.com
but all give the same result.
Does anyone know why this error is suddenly biting me, and what I can do to resolve it?
After literally hours of fiddling around, I've figured out that changing
jc.User = "chatbot#ourdomain.com";
to
jc.User = "chatbot";
solves the issue. Quite why it's worked for years, and has now suddenly stopped, is beyond me - I guess Google flipped a switch somewhere. Problem solved anyway, hopefully this will help someone else.

TIBCO EMS connection not resolving in C#

I am working with a program that is meant to publish to and read from an existing TIBCO EMS hosted on a server separate from the program. I have referenced the sample code provided with the TIBCO installation, resulting in a big chunk of the program. Here is the code snippet that I am having troubles with:
1 QueueConnectionFactory factory = new TIBCO.EMS.QueueConnectionFactory(serverUrl);
2 QueueConnection connection = factory.CreateQueueConnection(username,password);
3 QueueSession session = connection.CreateQueueSession(false, Session.AUTO_ACKNOWLEDGE);
When line 1 runs, it goes through alright. When line 2 runs, it goes through alright, however, the connection object is null, resulting in an error during line 3 where a NullReferenceException occurs.
I would have at least expected that line 2 would return some sort of error to show that the request timed out, the credentials were wrong, the url is inaccessible, or at least something to let me know what the issue is, but there is nothing like that, until it hits line 3.
Does it have to do with the configuration of my application? All I have done to get this working is include the TIBCO.EMS.dll as a reference and worked with the code from there.
Could it have something to do with the fact that I am connected to a VPN that requires a proxy? If so, how can I set up that proxy in my code?
Any help would be greatly appreciated. Thank you.
The issue was that I was using the wrong version of the .NET framework to work with the Tibco integration. The version I was using was farther along than the original.
It would think that your server URL is incorrect.
try different urls maybe like tcp://localhost:7222 (where localhost can be the IP/Name of the remote server)
install EMS locally on you workstation and see if you can connect to it. (Default admin with no password)

Categories

Resources