1

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.

Michal Leszczyk
  • 1,849
  • 15
  • 19
  • `please, correct me if I'm wrong` you are. If page is published as web service you can connect to it from anywhere using URL address of this web service. That is what address is used for, right? To know where resource is located. But you have to deal with authentication. May be this is why you cant connect. – Mak Sim Jul 25 '14 at 11:37
  • if you followed the article then try to replace `localhost` with DNS name or IP of Nav server. – Mak Sim Jul 25 '14 at 11:38
  • Hey hey! Just browsing through tags. Can you update your question with the solution you found and/or close it if you aren't going to add the additional detail you've got in italics? – Mat Nadrofsky Oct 07 '14 at 12:32
  • @MatNadrofsky sure, sorry. Totally forgot about this question. Updated :) – Michal Leszczyk Oct 07 '14 at 13:53
  • Thanks for coming back and adding the solution. That gets a +1 from me now! If you post your own answer to your question you can accept it as well thereby closing the loop. :) – Mat Nadrofsky Oct 07 '14 at 13:59

0 Answers0