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
Answers
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?
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?
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.
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: My codeunit creates XML file of the data I need. I have done this by creating XMLPort and then adding the following function to my codeunit 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.
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 part
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 helps
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.
Thank you loads for the answer and your wonderful blog.
Thank you one more time for sharing your knowledge =D>