I am exploring the CRM SDK (1.2) (on MS CRM v1.2) and tried a very basic
operation, which I copied from Microsoft's samples.
The following piece of code throws an exception:
string server = "server2";
string virtualdir = "mscrmservices";
string url = "http://"+server+"/"+virtualdir+"/";
Microsoft.Crm.Platform.Proxy.BizUser bizUser = new
Microsoft.Crm.Platform.Proxy.BizUser ();
bizUser.Credentials = System.Net.CredentialCache.DefaultCredentials;
bizUser.Url = url + "BizUser.srf";
Microsoft.Crm.Platform.Proxy.CUserAuth userAuth = bizUser.WhoAmI(); // <---
this throws an exception
After executing the last line above, the following exception is thrown:
System.InvalidOperationException: Client found response content type of '',
but expected 'text/xml'. The request failed with the error message: --
Server Error --. at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream, Boolean
asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
Microsoft.Crm.Platform.Proxy.BizUser.WhoAmI() at
Seek.ListStagePlekkenDetailForm.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\seek\liststageplekkendetailform.aspx.cs:line 36
What am I doing wrong here? Anything to do with IIS?
Regards,
Manfred