Web service using extension codeunit - Still need help

maris2000
Member Posts: 71
I have made a nav web service with extension codeunit, but I can not see the methods of the extension codeunit when I call it from .net.
I have verified the web service availability, and tested the service in .net before I added the extension codeunit and it worked fine.
The code unit calls XMLPort and and saves a XML file to the users hard drive.
Any suggestions on this issue?
Please help
I have verified the web service availability, and tested the service in .net before I added the extension codeunit and it worked fine.
The code unit calls XMLPort and and saves a XML file to the users hard drive.
Any suggestions on this issue?

0
Answers
-
I have added a new method to my codeunit and I can call it form .net app.
But why can't I see the method that should create XML?
I am little bit confused now.
How else can I create this XML file and save it on users computer?0 -
I am not sure that I understand what you are trying to accomplish.
Web Services runs on the service tier and there is no way you would be able to save something on the users computer from the service tier - that would be something you would do in the application in which you invoke the web service.
Also I am not sure what you mean by extension codeunit - you publish codeunits to web services through the webservice table and you "see" them in the WSDL - is this where you don't see some of the methods?Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
The Cu name in form 810 must have the same name than the page you want to extent and the cu publisher check box must be cleared.0
-
I'll try to explain myself a little bit better.
I need to export some data from a Navision table to MS Access table.
NAV 2009 SQL Classic Client is hosted and Access db is installed on the user's computer.
I have created web service and extended the default set of methods with a codeunit. (published codeunit to the web services through the webservice table)
I am Navision newbie so I sick to the terms from the documentation. The term "extension codeunit" comes from Microsoft Web Services Launch:The walkthrough illustrates how to publish a page with an extension codeunit as a Web service and use this published Web service from a console application. Adding an extension codeunit to a page is useful if you want to perform operations other than CRUD (create, read, update, and delete) operations on data.ExportItems() IF EXISTS('C:\XML_Item.xml') THEN ERASE('C:\XML_Item.xml'); TestFile.CREATE('C:\XML_Item.xml'); TestFile.CREATEOUTSTREAM(TestStream); XMLPORT.EXPORT(50010, TestStream); TestFile.CLOSE;
In .net part I have created an app in which I invoke the web service. I can access all the methods of the except mine "ExportItems", and this means that it is not present in WSDL file either.
I have added a few other functions to the same codeuinit and I can access them no problem.0 -
Putxi wrote:The Cu name in form 810 must have the same name than the page you want to extent and the cu publisher check box must be cleared.
The codeunit and the web service have the same name and codeunit check box is cleared. This part I know, but there is something wrong with XML part0 -
First of all, the functions exposed are the functions, where the first parameter is a Record type of the same Record as the page in which you expose the function.
Your ExportItems doesn't have any parameters and won't be exposed.
Secondly - note that your function tries to save something on the C:\ drive of the service tier - NOT the client tier.
The WebService function cannot reach the Client tier - as it is on a different machine and it probably doesn't have sufficient rights to write in the root folder of the C: drive on the service tier.
What you need to do is to have a function that returns your XML port as XML and then you can use it in the function that calls the webservice method.
There are a number of samples on how to do this on my blog.
Hope that helpsFreddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Hi Freddy,
Thank you loads for the answer and your wonderful blog.
Thank you one more time for sharing your knowledge =D>0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions