Credentials to use NAV Webservice

LouisLouis Member Posts: 78
Hello WS consumers
Suppose an NIX client application that want to consume a NAV2009 WS.
How to set the SOAP (domain)/user/password credentials to access a NAV2009 WS ?
Example welcome
TIA

Comments

  • kinekine Member Posts: 12,562
    You need to access under account, which have permissions in NAV. It means the common permission system is applied to webservice users like when accessing through RTC.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,304
    I don't know what a "NIX client application" is, so I might be dead wrong here. Like Rashed said, you need to program for Windows credentials that are set up as a valid NAV user with permissions to the area that the web service exposes. It looks like you are working in a non-Windows environment, which I have no experience with.

    Try to find some VB or C# code snippet that set Windows credentials, and see if you can make that work in your programming language. I'm sure that you are not the first person to do this :)
  • kinekine Member Posts: 12,562
    DenSter wrote:
    Like Rashed said...
    Where??? :whistle:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • LouisLouis Member Posts: 78
    Thank you for your comforting talk. :wink:
    Yes I want to test (later) in a non-Windows environment.
    Your suggestion of VB or C# code snippet that set Windows credentials is not applicable because they use .NET to set the credentials of the web service to True.
    You're sure that I'm not the first person to do this ... ](*,) but I'm facing an Authorization Issue.
    Yes - how/when/where to pass the "credentials" using SOAP/HTTP/PROXY etc ?
    TIA
  • ara3nara3n Member Posts: 9,256
    edited 2009-02-07
    Nav webservices is build with wcf service. And it authenication is done through Kerebos. So your *nix box need to be setup to authenticate with active directory. There are three solution to this. You can use LDAP, Kerberos, and Winbind on linux machines.

    I hope MS NAV releases some how-to for other OS or java languages to authenicate with NAV webservices.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,256
    kine wrote:
    DenSter wrote:
    Like Rashed said...
    Where??? :whistle:

    here :mrgreen:
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • LouisLouis Member Posts: 78
    I call the NAV soap web service through a WSDL proxy.
    Discovering The Available Methods works fine.
    Discovering The Method's Arguments works fine.
    Discovering The Method's Return Values works fine.

    But when I call the NAV WS Method, I get HTTPError: <HTTPError 401 Unauthorized>
    How to be authorized ?
  • DenSterDenSter Member Posts: 8,304
    kine wrote:
    DenSter wrote:
    Like Rashed said...
    Where??? :whistle:
    i mean you Rashed :oops: :whistle:
  • DenSterDenSter Member Posts: 8,304
    Louis wrote:
    Your suggestion of VB or C# code snippet that set Windows credentials is not applicable because they use .NET to set the credentials of the web service to True.
    Yes I am aware that you are not working in a .NET environment. However, by finding a .NET code snippet, you can learn how credentials are built there, and figure out a way to do the same in your programming language. If that won't work then find a code snippet in your *NIX programming language that constructs Windows credentials, I am sure that has been done before. The reason I am saying try to find a VB/C# sample is that often in C/AL we can access the object model directly, and the code snippets help to build the construct in the C/AL programming language. I assumed that these type of sample code is available for your programming language as well.

    If I were you I would start by trying to find a connection string sample in your language into a SQL Server database, those often use this type of credentials. I can remember from my VBA days that it was possible to send login, password and domain into some sort of credentials object, and that would authenticate the connection string.
  • ara3nara3n Member Posts: 9,256
    what language and what OS are you working on?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • LouisLouis Member Posts: 78
    I'm trying to access the WS with Python in a VPC NAV2009
  • DenSterDenSter Member Posts: 8,304
    Simple Google search on "Python forum":
    http://www.python-forum.org/pythonforum/index.php
    http://www.daniweb.com/forums/forum114.html
    http://www.python.org/community/lists/
    http://forums.devshed.com/python-programming-11/

    Check out those forums. I'll bet you'll find code snippet for creating Windows credentials in there somewhere.
  • LouisLouis Member Posts: 78
    I checked out those forums. But didn't find concrete suggestions.
    Do you have more specific search terms - I looked for credentials and kerberos.
    Another idea to make it more clear for me - suppose your are not logged in (difficult) - how did you manage the authorization aspects in your code (C#, java, python or other language) ?
    Sorry for my ignorance of what is behind the C# credentials. Your help will be welcome. TIA.
  • DenSterDenSter Member Posts: 8,304
    Usually there's a way to set login, password and domain name in some sort of object model that you have to set a reference to. When you work with VBA, access those object models are provided in the IDE, and the dll's that provide those models are registered as part of the toolset. You would have to figure out how you can access the relevant object model from your development environment. I don't know anything about that, so I'm afraid I can't help you with that.

    It's part of the job to figure those types of things out. Unless someone has the answer ready for you, or someone is willing to do your work for you, you're going to have to figure that one out yourself.
Sign In or Register to comment.