Errors using a WCF Client to connect to NAV Web Service

TFCrowther
Member Posts: 35
Here is the details of the WCF Client configuration:
Running the above to execute Nav 2009 Web Services returns this error:
System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header
received from the server was 'Negotiate'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
If we remove the last line (customer_PortClient.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation), this error is returned:
System.ServiceModel.FaultException: Access denied. Delegation or Impersonation permission is required for access.
Any suggestions on how to resolve this?
Thanks
Toby
BasicHttpBinding basicHttpBinding = new BasicHttpBinding(); basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; string endPointAddr = "http://localhost:7047/DynamicsNAV/WS/Vulcan/Page/Customer"; EndpointAddress endpointAddress = new EndpointAddress(endPointAddr); Customer_PortClient customer_PortClient = new Customer_PortClient(basicHttpBinding, endpointAddress); customer_PortClient.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
Running the above to execute Nav 2009 Web Services returns this error:
System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header
received from the server was 'Negotiate'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
If we remove the last line (customer_PortClient.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation), this error is returned:
System.ServiceModel.FaultException: Access denied. Delegation or Impersonation permission is required for access.
Any suggestions on how to resolve this?
Thanks
Toby
0
Comments
-
Instead all the things around credentials you can only set the UseDefaultCredentials to true and you are done.0
-
Hi!
I have a similar problem. I try to connect a WCF Content type (external list) to a Sharepoint 2010 list.
I did it over Web Service and C# but my requirements state that it should be done over BCS.
The error on the page is the following:
- Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
In the log I have found:
- You don't have Add and Customize Pages permissions required to perform this action.
Even though I am using an administrator account which has owner permissions...
Did I miss somewhere to set permissions?
Thanks for your help!
Btw. TFCrowther I see are from New Zealand. I envy you. I spend the last year there, but had to return 3 months ago.0 -
Hi TFCrowther and jdellatorre
You don't give me much to go on.
However reading through the posts I got an idea of what might be wrong on your setup.
You might be running to new Visual Studio. NAV Web Services where written to work well with how VS does things.
Problem was that VS changed how it does things. 2008 does WS little bit differently than previous versions.
You can however ask it to treat it like it is older version and then you should be fine.
I don't remember the switch name for this but some body here should be able to help you.
But after you turn on that switch kine’s solution should work.
thanks
Kris Rafnsson0 -
TFCrowther wrote:Any suggestions on how to resolve this?
It's necessary to use "Identification" instead of "Impersonation"...
If you will use "Identification" all the processing done in the service will run as the default user (when a call is made to the service, the service will process the request as the default user for that service).0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions