Strange Exception on Consuming Simple Webservice
sharad
Member Posts: 112
Hello Friends,
I have made a CU with a single function to insert some data to a table and publish this CU. When I consume this Service It gives the 1st time exception - "Object of type Page with id 50087 could not be found.". I don't have this page. 2nd time Exception - Metadata for object of type Page with id 50087 is in a failed state. This is caused by a previous exception: Object of type Page with id 50087 could not be found.. For this I follow steps provide in this link http://saurav-nav.blogspot.in/2012/02/metadata-for-object-of-type-table-with.html . Multiple time Restarted Services of NAV and Sql but not done. Then I made a page of the same table after doing this a new Exception generate - "Client callback (such as showing Pages) is not supported when executing custom Web services.".
I have a very simple CodeUnit as given Below
OnRun()
CreatePullOutReq(TransactionID : Text[200];RequestBy : Code[20];VehicleID : Code[20];RequestID : Code[20];Reason : Text[30])
IF GUIALLOWED THEN BEGIN
EntryNo:=0;
RecWebAppTransactions.RESET;
IF RecWebAppTransactions.FINDLAST THEN
EntryNo:= RecWebAppTransactions."Entry No."
ELSE
EntryNo:=0;
RecWebAppTransactions.INIT;
RecWebAppTransactions."Entry No." := EntryNo+1;
RecWebAppTransactions.Type := RecWebAppTransactions.Type::"4";
RecWebAppTransactions."Document No." := RequestID;
RecWebAppTransactions."Vehicle Id" :=VehicleID;
RecWebAppTransactions."Document Date" := TODAY;
RecWebAppTransactions."Confirmation Date" := TODAY;
RecWebAppTransactions.Remarks := Reason;
RecWebAppTransactions.INSERT;
END;
and Asp.Net Code
protected void Button1_Click(object sender, EventArgs e)
{
NetworkCredential nc1 = new NetworkCredential("Administrator", "abc", "1.1.1.1");
ws3.Credentials = nc1;
ws3.CreatePullOutReq("CDEF7890-ABCD-0123-1234-567890BABDBF", "Web", "FA000001", "REQ-00001", "Break Fail");
}
I waste much time on this but can't understand why this exception occur.
Please Help me on this.
Thanks in Advance.
I have made a CU with a single function to insert some data to a table and publish this CU. When I consume this Service It gives the 1st time exception - "Object of type Page with id 50087 could not be found.". I don't have this page. 2nd time Exception - Metadata for object of type Page with id 50087 is in a failed state. This is caused by a previous exception: Object of type Page with id 50087 could not be found.. For this I follow steps provide in this link http://saurav-nav.blogspot.in/2012/02/metadata-for-object-of-type-table-with.html . Multiple time Restarted Services of NAV and Sql but not done. Then I made a page of the same table after doing this a new Exception generate - "Client callback (such as showing Pages) is not supported when executing custom Web services.".
I have a very simple CodeUnit as given Below
OnRun()
CreatePullOutReq(TransactionID : Text[200];RequestBy : Code[20];VehicleID : Code[20];RequestID : Code[20];Reason : Text[30])
IF GUIALLOWED THEN BEGIN
EntryNo:=0;
RecWebAppTransactions.RESET;
IF RecWebAppTransactions.FINDLAST THEN
EntryNo:= RecWebAppTransactions."Entry No."
ELSE
EntryNo:=0;
RecWebAppTransactions.INIT;
RecWebAppTransactions."Entry No." := EntryNo+1;
RecWebAppTransactions.Type := RecWebAppTransactions.Type::"4";
RecWebAppTransactions."Document No." := RequestID;
RecWebAppTransactions."Vehicle Id" :=VehicleID;
RecWebAppTransactions."Document Date" := TODAY;
RecWebAppTransactions."Confirmation Date" := TODAY;
RecWebAppTransactions.Remarks := Reason;
RecWebAppTransactions.INSERT;
END;
and Asp.Net Code
protected void Button1_Click(object sender, EventArgs e)
{
NetworkCredential nc1 = new NetworkCredential("Administrator", "abc", "1.1.1.1");
ws3.Credentials = nc1;
ws3.CreatePullOutReq("CDEF7890-ABCD-0123-1234-567890BABDBF", "Web", "FA000001", "REQ-00001", "Break Fail");
}
I waste much time on this but can't understand why this exception occur.
Please Help me on this.
Thanks in Advance.
Sharad Gupta
Navision Technical Consultant & .Net Developer
Navision Technical Consultant & .Net Developer
0
Comments
-
Hi sharad,
On which version you are trying this?
I think the error is from the dotnet part of the application not from the Navision. I will try to replicate it in NAV 2013 R2 and will update you.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
Hi Saurav,
I am using NAV2009 R2.Sharad Gupta
Navision Technical Consultant & .Net Developer0 -
Client callback errors are there to warn your code is showing a confirm or message. Try it out in classic.0
-
Hi Friends
There is no confirmation dialog or message i return. simple insertion process is there in codeunit. I can't understand why this problem occur. Please Help.Sharad Gupta
Navision Technical Consultant & .Net Developer0 -
Hi sharad,
I tried to replicate the issue in NAV 2013 R2 and was able to find it. I hope the changes suggested below should resolve your issue -
1) Created a table as per your design (Hope so).
2) Created a codeunit as per your code. (Modified code - Why GUIALLOWED?)
3) Created a DotNet Application and the code is as shown below (Why Code for authentication is so tough?)
4) I run the code and here is the output in my table.
Let me know if I missed anything. I hope you will be able to resolve the problem that you are facing.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
