Unfortunately, I'm away from my computer now, I'll post my code and the error message as soon as I can, but maybe you'll have some suggestions without it?
I need to create a WCF Service Library which then I need to use as a proxy to connect to Microsoft Dynamics NAV 2009 R2 database from other applications.
I know, that I can easily connect to NAV's "Pages" from my application and extract data directly from them, but that will only work if the application is hosted at the same machine as Dynamics (please, correct me if I'm wrong).
When connecting to Dynamics NAV "pages" (which are web services) the tables are being mapped to classes, which then can be used in application. There is no problem as long as I'm not trying to make my OperationContract
return objects of this classes (if I do that, I'm getting an error saying something about service metadata - I'll post the exact message when I'll be home).
I don't know if it's simply impossible (maybe because of some security reasons?) or I'm doing something wrong? I tried to follow this article.
Is there any other way to do that besides manually converting those objects to my own classes?
Thanks in advance!
UPDATE
I'm really sorry, totally forgot about this question.
I did not find a solution to my problem. However, I found out, that if I use "Web reference" instead of "Service reference", then I can reuse the datatypes returned by MS Dynamics NAV and return them as a result of my proxy's methods (don't really know why did it work this way, but it did). I did not want to use web reference, so I decided to create my own datatypes (data contracts) and map only the properties I needed. It was a good solution for me, since from most tables I needed only a few properties.
The question can be closed.