Options

NAV2013 Web Service

sydaussydaus Member Posts: 10
edited 2013-03-27 in NAV Three Tier
Hi,

I tried to run a test program to call a DOT NET dll to run a codeunit that published on web service, but I got the following error message:

This message is for C/AL programmers: A call to XXX.XXX.XXX (dot net dll variable) failed with this message: The length of the string is 28, but it must be less than or equal to 20 characters. Value: NT AUTHORITY NETWORK SERVICE

I have a user id (NT AUTHORITY\NETWORK SERVICE) in SQL server, but I am not sure of whether there are any relations on this.
Does anyone have ideas on this?

Thanks.

Comments

  • Options
    kinekine Member Posts: 12,562
    Looks like some code is using USERID and saving it into variable of length 20.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    sydaussydaus Member Posts: 10
    kine wrote:
    Looks like some code is using USERID and saving it into variable of length 20.
    I checked my program again, but didn't use USERID in my codes. And also my login ID was not "NT AUTHORITY\NETWORK SERVICE".
    There is USER ID "NT AUTHORITY\NETWORK SERVICE" in the SQL database.
  • Options
    kinekine Member Posts: 12,562
    What about codeunit 1 code? The problem could be there (you can try it by creating some simple webservice doing nothing and call it. If there is still same error, then problem could be in CU1). And that your account is different could mean that delegation is not workng correctly or something similar.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    sydaussydaus Member Posts: 10
    Hi,

    I found the problem. We can't use the Default Credentials.

    ws.UseDefaultCredentials = true; // The code will use default ID "NT AUTHORITY\NETWORK SERVICE"

    Changed the codes to:
    ws.Credentials = new NetworkCredential("XX", "XXXX", "XXXX"); //User ID, Password, Domain.
Sign In or Register to comment.