473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CRM webservice error

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.Wh oAmI(),

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

}

}
Nov 21 '05 #1
3 4184
What error are you getting and on which call is it being raised?

Matt Parks
MVP - Microsoft CRM

----------------------------------------
----------------------------------------
On Thu, 25 Nov 2004 11:55:21 +0100, "Eric van der Niet" <ev**@realdata.nl>
wrote:

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.Wh oAmI(),

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

}

}
Nov 21 '05 #2
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\s ecurity\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:00********************************@4ax.com...
What error are you getting and on which call is it being raised?

Matt Parks
MVP - Microsoft CRM

----------------------------------------
----------------------------------------
On Thu, 25 Nov 2004 11:55:21 +0100, "Eric van der Niet" <ev**@realdata.nl>
wrote:

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.Wh oAmI(),

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

}

}

Nov 21 '05 #3
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

----------------------------------------
----------------------------------------
On Wed, 1 Dec 2004 09:12:24 +0100, "Eric van der Niet" <ev**@realdata.nl> wrote:

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\s ecurity\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:00********************************@4ax.com...
What error are you getting and on which call is it being raised?

Matt Parks
MVP - Microsoft CRM

----------------------------------------
----------------------------------------
On Thu, 25 Nov 2004 11:55:21 +0100, "Eric van der Niet" <ev**@realdata.nl>
wrote:

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.Wh oAmI(),

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

}

}

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
4
by: Tim Gallivan | last post by:
Hello group, I'm trying to develop a proof of concept webservice which asynchronously calls a function in a DLL. The function raises an event when it is finished, and works when used as part of...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i donīt want to filter the return value of the method, i have to pass a new instance of the...
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
0
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
1
by: UT-BadBoy | last post by:
Hi, I've been receving this error "System.InvalidOperationException: The namespace, , is a duplicate." and have been unable to locate the exact cause of the exception. I've written a...
2
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= | last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0. This problem can be shown when trying to access a WebService using SSL and through a proxy server after using the...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
7
by: Amirallia | last post by:
Hi, I consume my webservice with the IE browser and all is ok when I call it with one browser. But when I call it a the same time with two browsers, the IE page tells me that the apllication...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.