Visual C# Professional 2012 and NAV Web Service

SDISDI Member Posts: 5
edited 2014-11-13 in NAV Three Tier
Well, C# 2012 is now available and I'm probably the pioneer here, but so far I can find the same buttons / menu as is described in walk through directions for 2010, yet I'm getting an error.

I have NAV running and the web service started and the customer list being published by NAV as a code page. When I paste the URL into IE, I get an XML reply, which I believe is correct.

http://localhost:7047/DynamicsNAV/WS/CR ... ./services

XML reply:

<?xml version="1.0"?>
-<discovery xmlns="http://schemas.xmlsoap.org/disco/&quot;
xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
<contractRef xmlns="http://schemas.xmlsoap.org/disco/scl/&quot;
ref="http://localhost:7047/DynamicsNAV/WS/CRONUS EXT USA, Inc/SystemService"/>
<contractRef xmlns="http://schemas.xmlsoap.org/disco/scl/&quot;
ref="http://localhost:7047/DynamicsNAV/WS/CRONUS EXT USA, Inc/Page/Customer"/>
</discovery>

As far as I know, VS C# will connect to this same web service and I followed the same instructions as VS 2010:
I opened it as a new project ; WindowsFormApplication, right clicked References, Service Reference Settings; (at bottom) Add Web Reference
In the Add Web Reference window it asks for the URL, so I paste the same URL and click Web Services on local machine:

http://localhost:7047/DynamicsNAV/WS/CR ... ./services

and I get this error:

There was an error while enumerating services on local machine:
Active Directory Services cannot find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. Another possible cause is that IIS is not installed on the local machine, or the user identity under which you are running may not have permissions to view websites on this machine. To view websites on this machine, make sure that you run Visual Studio as administrator. On Windows Vista computers with IIS installed, make sure that IIS Metabase and IIS 6 configuration compatibility feature is enabled.


Am I actually running IIS ? I guess so.

Help is appreciated..

Comments

  • EgnazEgnaz Member Posts: 111
    Hi,

    I tried it with the OData Service (Port 7048) and VS20212 RC.
    No connection problems.

    // Edit:
    I just added a Service Reference to "http://localhost:7048/DynamicsNAV70/OData/&quot;
    Used the NAV Help to build the demo.
    Check Walktrough from Help for SOAP:


    When do you get the error? By adding the web reference or by running the code?

    Regards,
    Egnaz
  • SDISDI Member Posts: 5
    Instead of clicking on Web service for local machine. I just put in the URL and hit --> (go) and then it worked.

    So that brings me to the Program.cs and the sample being used is Letters service, if you look at consuming a web page:
    http://msdn.microsoft.com/en-us/library/dd339004

    So I replace the code in the window with the code on the msdn site and I get an error:
    "The type or namespace name 'WebService' could not be found."

    .. Any ideas ?
  • SDISDI Member Posts: 5
    When I added the WebService, it added it as localhost, I changed the name to WebService and hit F5 and I got a SOAP exception unhandled on the line that calls NAV.
    // Call the Microsoft Dynamics NAV codeunit Web service.
    outputstring = ws.Capitalize(inputstring);

    Soap exception unhandled
    Service "services" was not found!

    ??
  • SDISDI Member Posts: 5
    ok... nm.. I closed the debugger and opened the Solutions Explorer, mainly because I didnt know how to exit the debug mode. So then I hit F5 once more and it worked fine. So at least I get the desired results, sort of..

    Now I have to connect to ConnectWise. Oh.. This should be fun. *sarcasm*
  • RonTaylorRonTaylor Member Posts: 4
    I am working on an integration to ConnectWise for our organization. You mentioned you were working on connecting also. Did you ever get a connection going? We are planning on using ConnectWise to support our Dynamics NAV and network services call management needs and want to get invoicing data out of ConnectWise. Any insights you have would be appreciated. :)
    Ron Taylor
    ICS Support, Inc.
    8541 154th Ave. NE
    Redmond, WA. 98052
Sign In or Register to comment.