Call Exposed Web Service from Outside

theMediatortheMediator Member Posts: 6
edited 2011-01-12 in NAV Three Tier
My goal is to be able to expose Codeunits as Web Services and to be able to access their data from a data outside the network using VB .Net.

I was able to do this inside the network by creating a Visual Basic (or C#) project and connecting to a Web Service at this address: http://localhost:7047/DynamicsNAV/WS/CR ... ./services

However, that address obviously won't work anywhere but on the host machine.

I'm trying to do the same thing, just outside the network and that's where I'm coming up empty.

Any help would be appreciated.

Comments

  • kinekine Member Posts: 12,562
    Of course, localhost is only localhost, not accessible from outside... ;-) you need to use real server name
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • theMediatortheMediator Member Posts: 6
    I've tried replacing localhost with the machine name and the ip address but neither works. Unless you mean something else by "real server name".
  • kinekine Member Posts: 12,562
    Of course, check that the port is open on firewall on the server.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • theMediatortheMediator Member Posts: 6
    You were right. The port hadn't been opened yet.

    Thank you for the simple solution.
  • theMediatortheMediator Member Posts: 6
    Now I don't suppose there is any way of doing the same thing, outside of the same domain?
  • ara3nara3n Member Posts: 9,256
    you can call outside of domain as well. as long as you can ping the computer outside of network you can connect to the pc. You'll have to do port forwarding at the router.
    You'll also in your .NET app create new network credentials and specify login and password in your code.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • theMediatortheMediator Member Posts: 6
    Sorry for the late reply, but the scenario I'm working in is multiple domains, same network.

    As long as I am logged in under the same domain, I can access the services using a connection string like this:
    http://[computer name]:7047/DynamicsNAV/WS/CRONUS%20Canada,%20Inc./services

    However, if I am outside of that domain, even logged into the same computer, that string no longer works.

    If I replace the computer name with the static ip of that computer, I get two security prompts: one for the computer logon, and then one for the service.

    This is where I get stumped, I am not aware of a username and password combo for the service. What am I doing wrong?
  • kinekine Member Posts: 12,562
    All depends on how your network is configured, how the PC is connected (directly, VPN etc.), how the DNS and other things are set etc. Had to say something without detailed info about the configuration...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.