SOAP Error upon calling a webservice(Codeunit 6810 failed state).

Hello,

I have created a codeunit that is revealed as a webservice, it runs an xmlport that grabs from a local file and adds a customer record. I am hitting the error that says:

Metadata for object of type CodeUnit with id 6810 is in a failed state. This is caused by a previous exception:

The NAV System has changed while you were performing your activity. Please close your current task and try again. If you are unable to complete the activity, please contact your System Administrator.

Information for developers: Another user has modified CodeUnit 6810. Because the underlying data does not exist or is a different type, the object cannot be compiled correctly until the problem is fixed.

Error details: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit6810.cs(662,43) : error CS1501: No overload for method ‘ToNavAutomation’ takes ‘1’ arguments

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: Metadata for object of type CodeUnit with id 6810 is in a failed state. This is caused by a previous exception:

The NAV System has changed while you were performing your activity. Please close your current task and try again. If you are unable to complete the activity, please contact your System Administrator.

Information for developers: Another user has modified CodeUnit 6810. Because the underlying data does not exist or is a different type, the object cannot be compiled correctly until the problem is fixed.
Error details: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit6810.cs(662,43) : error CS1501: No overload for method ‘ToNavAutomation’ takes ‘1’ arguments

I am at a loss, I have searched for the issue.

I have run my codeunit manually without issues.

I have recompiled the 6810 codeunit.

I have deleted the record from the metadata table and recompiled CU 6810.

Here is my code:

using CustomerLoad;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void ObjectDataSource1_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
WebApplication2.Countries.WS_Countries_Service webservice = new WebApplication2.Countries.WS_Countries_Service();
string WebServiceURL = “…/WS_Countries”;
webservice.Url = WebServiceURL;
webservice.Credentials = CredentialCache.DefaultNetworkCredentials;
e.ObjectInstance = webservice;
}

protected void Button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
string ab1=this.tb1.Text;
string ab2 = this.tb2.Text;
string ab3 = this.tb3.Text;
string ab4 = this.tb4.Text;
string ab5 = this.tb5.Text;
string ab6 = this.tb6.Text;
string ab7 = this.ddl1.Text;
string ab8 = this.tb7.Text;
string ab9 = this.tb8.Text;
string ab10 = this.tb9.Text;
doc.Load("…\XML\XMLFile1.xml");
//XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
// nsmgr.AddNamespace(
XmlElement root = doc.DocumentElement;
XmlNode name = root.SelectSingleNode(“Customer/Name”);
XmlNode address = root.SelectSingleNode(“Customer/Address”);
XmlNode address2 = root.SelectSingleNode(“Customer/Address_2”);
XmlNode city = root.SelectSingleNode(“Customer/City”);
XmlNode state = root.SelectSingleNode(“Customer/County”);
XmlNode zipcode = root.SelectSingleNode(“Customer/Post_Code”);
XmlNode country = root.SelectSingleNode(“Customer/Country_Region_Code”);
XmlNode contact = root.SelectSingleNode(“Customer/Contact”);
XmlNode phone = root.SelectSingleNode(“Customer/Phone_No”);
var email = root.SelectSingleNode(“Customer/E_Mail”);
name.InnerText = ab1;
address.InnerText = ab2;
address2.InnerText = ab3;
city.InnerText = ab4;
state.InnerText = ab5;
zipcode.InnerText = ab6;
country.InnerText = ab7;
contact.InnerText = ab8;
phone.InnerText = ab9;
email.InnerText = ab10;
doc.Save("…\XML\XMLFile1.xml");
//WS_CustomerLoad cl = new WS_CustomerLoad();
WS_CustomerLoad webservice = new WS_CustomerLoad();
string WebServiceURL = “…WS_CustomerLoad”;
webservice.Url = WebServiceURL;
webservice.Credentials = CredentialCache.DefaultNetworkCredentials;
webservice.CallFromWeb();

Got error to go away with:

-reboot server

-delete that line from object metadata table

  • recompile all

Hi d.bta…

Please i have the same probleme as yours, did you have found the solution.

Please answer me if you can…

Thank you in advance…