Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

CRM webservice error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric van der Niet - 25 Nov 2004 10:55 GMT
I have thuis webservice. Used to get account information out of microsoft
crm. But is reply's an error! can someone see whats the error in this
code???? Help!

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Diagnostics;

using System.Web;

using System.Web.Services;

using System.Xml;

using Microsoft.Crm.Platform.Proxy;

namespace FetchAllAccounts

{

public class FetchAllAccounts : System.Web.Services.WebService

{

// You must change this to the URL for your Microsoft CRM server.

private const string _strCRMURL = "http://hil-mem-03/mscrmservices/";

/// <summary>

/// Retrieve a summary of all accounts in the database.

/// </summary>

[WebMethod]

public XmlNode Fetch()

{

// Create BizUser proxy object.

BizUser objBizUser = new BizUser();

objBizUser.Credentials

= System.Net.CredentialCache.DefaultCredentials;

objBizUser.Url = _strCRMURL + "BizUser.srf";

// Create CRMQuery proxy object.

CRMQuery objQuery = new CRMQuery();

objQuery.Credentials = objBizUser.Credentials;

objQuery.Url = _strCRMURL + "CRMQuery.srf";

string strAllAccountsFetchXML =

@"<fetch mapping='logical'>

<entity name='account'>

<attribute name = 'name'/>

<attribute name = 'accountid'/>

</entity>

</fetch>";

// Execute the query and return the result set.

// If an exception occurs, return the error message instead.

XmlDocument xmlDoc = new XmlDocument();

try

{

xmlDoc.LoadXml(objQuery.ExecuteQuery(objBizUser.WhoAmI(),

strAllAccountsFetchXML));

return xmlDoc;

}

catch (System.Web.Services.Protocols.SoapException err)

{

xmlDoc.LoadXml("<Error/>");

xmlDoc.DocumentElement.InnerText = strAllAccountsFetchXML; //err.ToString();

return xmlDoc.DocumentElement;

}

}

#region Component Designer generated code

public FetchAllAccounts()

{

//CODEGEN: This call is required by the ASP.NET Web Services Designer

InitializeComponent();

}

//Required by the Web Services Designer

private IContainer components = null;

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if(disposing && components != null)

{

components.Dispose();

}

base.Dispose(disposing);

}

#endregion

}

}
Matt Parks - 29 Nov 2004 18:01 GMT
What error are you getting and on which call is it being raised?

Matt Parks
MVP - Microsoft CRM

----------------------------------------
----------------------------------------

I have thuis webservice. Used to get account information out of microsoft
crm. But is reply's an error! can someone see whats the error in this
code???? Help!

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Diagnostics;

using System.Web;

using System.Web.Services;

using System.Xml;

using Microsoft.Crm.Platform.Proxy;

namespace FetchAllAccounts

{

public class FetchAllAccounts : System.Web.Services.WebService

{

// You must change this to the URL for your Microsoft CRM server.

private const string _strCRMURL = "http://hil-mem-03/mscrmservices/";

/// <summary>

/// Retrieve a summary of all accounts in the database.

/// </summary>

[WebMethod]

public XmlNode Fetch()

{

// Create BizUser proxy object.

BizUser objBizUser = new BizUser();

objBizUser.Credentials

= System.Net.CredentialCache.DefaultCredentials;

objBizUser.Url = _strCRMURL + "BizUser.srf";

// Create CRMQuery proxy object.

CRMQuery objQuery = new CRMQuery();

objQuery.Credentials = objBizUser.Credentials;

objQuery.Url = _strCRMURL + "CRMQuery.srf";

string strAllAccountsFetchXML =

@"<fetch mapping='logical'>

<entity name='account'>

<attribute name = 'name'/>

<attribute name = 'accountid'/>

</entity>

</fetch>";

// Execute the query and return the result set.

// If an exception occurs, return the error message instead.

XmlDocument xmlDoc = new XmlDocument();

try

{

xmlDoc.LoadXml(objQuery.ExecuteQuery(objBizUser.WhoAmI(),

strAllAccountsFetchXML));

return xmlDoc;

}

catch (System.Web.Services.Protocols.SoapException err)

{

xmlDoc.LoadXml("<Error/>");

xmlDoc.DocumentElement.InnerText = strAllAccountsFetchXML; //err.ToString();

return xmlDoc.DocumentElement;

}

}

#region Component Designer generated code

public FetchAllAccounts()

{

//CODEGEN: This call is required by the ASP.NET Web Services Designer

InitializeComponent();

}

//Required by the Web Services Designer

private IContainer components = null;

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if(disposing && components != null)

{

components.Dispose();

}

base.Dispose(disposing);

}

#endregion

}

}
Eric van der Niet - 01 Dec 2004 08:12 GMT
This is the error:

<?xml version="1.0" encoding="utf-8" ?>
 <Error>ErrorMessage: SOAP Server Application Faulted
<detail><error><code>80040225</code><description>The specified user is
either disabled or is not a member of any business
unit.</description><file>d:\crm\build\3297\src\platform\security\crmsecurity\secmain.cpp</file><line>2281</line></error></detail>
Source: System.Web.Services</Error>

> What error are you getting and on which call is it being raised?
>
[quoted text clipped - 172 lines]
>
> }
Matt Parks - 01 Dec 2004 15:59 GMT
The user you are trying to connect to CRM with needs to be a valid, licensed CRM
user.  in other words, that user needs to be able to access CRM.

Matt Parks
MVP - Microsoft CRM

----------------------------------------
----------------------------------------

This is the error:

<?xml version="1.0" encoding="utf-8" ?>
 <Error>ErrorMessage: SOAP Server Application Faulted
<detail><error><code>80040225</code><description>The specified user is
either disabled or is not a member of any business
unit.</description><file>d:\crm\build\3297\src\platform\security\crmsecurity\secmain.cpp</file><line>2281</line></error></detail>
Source: System.Web.Services</Error>

"Matt Parks" <mattp65@Yax_RemoveDashAndX_xhoo.com> schreef in bericht
news:00pmq0dumhnirsudofnr1jh4aql2o24cjn@4ax.com...
> What error are you getting and on which call is it being raised?
>
[quoted text clipped - 174 lines]
>
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.