Hello
I get an error 401 - not authenticated when calling a web service from within Ax 2012. I not allowed to call the web service as "Anonynous" as I am doing not.
How can I pass credentials to the 'client'?
Best regards
Lars
CodeAccessPermission permission; System.Exception ex; ; permission =
new
InteropPermission(InteropKind::ClrInterop);
permission.assert();
// Always try and catch errors as CLR exceptions
try
{
// Retrieve the X++ type for the service client object.
clientType = CLRInterop::getType(
"CmsService.GN.Services.CmsServiceSoapClient"
);
// Use the AifUtil class to create an instance of the service client object.
_client = AifUtil::CreateServiceClient(clientType); request =
new
CmsService.GN.Services.GetThirdPartyProductsRequest();
*This post is locked for comments
AFAIK you should set the appropriate credential type (e.g. NTLM) in app.config of your WCF client application, i.e. in your VS project.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156