Hello. I'm brand new to SplendidCRM so bear with me. I am running version 5.0.4058.17141 on Windows 7 Ultimate x64. I am running on IIS 7.5 in the .Net 4 Framework. I have built a test windows forms application to play around with the webservice.
splendidClient.ClientCredentials.UserName.UserName = "user";
splendidClient.ClientCredentials.UserName.Password = null;
user_auth auth = new user_auth();
auth.user_name = "user";
auth.password = null;
string s = splendidClient.test("testing");
//this works. s is "testing" at this point.
s = splendidClient.get_splendid_version();
//this also works. s is now "5.0.4058.17141"
string createResult = splendidClient.create_session("user", null);
//this fails with an System.ServiceModel.ProtocolException with an inner exception of {"The data at the root level is invalid. Line 1, position 1."}
var result = splendidClient.login(auth, "SplendidTest");
So i fired up fiddler to see what the invalid data looked like. Here's the raw view:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=nyc0q2yl2zbnalfcnxi2pu55; path=/; HttpOnly
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Fri, 11 Feb 2011 22:26:06 GMT
Content-Length: 647
Object reference not set to an instance of an object.<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.sugarcrm.com/sugarcrm" xmlns:types="http://www.sugarcrm.com/sugarcrm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><types:create_sessionResponse><create_sessionResult xsi:type="xsd:string">Success</create_sessionResult></types:create_sessionResponse></soap:Body></soap:Envelope>
This seems very weird to me. I am debugging on the server side as well. I can see that the webmethod is completing without exception. The object that it is trying to return is correct. I can't figure out what would be injecting that 'Object reference not set to an instance of an object.' into the body of the response. Also, it seems to only be occuring in methods that require username and passwords.
Just as another example, I am able to call create_lead and the lead is inserted into the database, but the client receives a response with this same problem.
Any ideas?
The first thing I would try is to using .NET 3.51 SP1 on the server instead of .NET 4.0. To do this, change the Application Pool to use 2.0 instead of 4.0.
Thanks for the prompt response. That was the first thing I tried. I changed the application pool's .NET Framework to v.2.0. I also changed the Target framework of the website to .NET Framework 3.5 and rebuilt. Unfortunately, I receive the same result.
We will look into this. In the mean time, can you use Visual Studio to debug the issue?
Instead of passing null as the password, pass an empty string or a valid password.