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

Re: Need help: Client found response content type of '', but expected 'text/xml' after simple SDK call. by GreaterThanTwo

GreaterThanTwo
Mon Jan 26 12:33:42 CST 2004

There is sometimes an IIS bug with registering handlers with long file names
(i.e. the CRM SOAP handler). You may need to call MS support to
resolve...they have an article on it.

Mike


"Meranti" <.> wrote in message
news:%23fgtJe04DHA.2168@TK2MSFTNGP12.phx.gbl...
> 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
>
>