Authentication failed because the remote party has closed the transport stream.
Franclim_Mendes
Member Posts: 4
Hello,
My customer uses NAV2017 version and wants to call a "webservice" published by a parter and this webservice uses Post and Get methods.
I've searched and tried to use standard codeunit 1297 and my code was something like this:
ltxtUrl := STRSUBSTNO(STRSUBSTNO(ltxtAddress,'1',pRecContact."E-Mail"));
lCduHttpWebRequestMgt.Initialize(ltxtUrl);
lCduHttpWebRequestMgt.DisableUI;
lCduHttpWebRequestMgt.SetMethod('GET');
lCduHttpWebRequestMgt.SetReturnType('application/xml');
lCduHttpWebRequestMgt.SetContentType('application/xml');
lCduHttpWebRequestMgt.GetResponse(lInStreamResponse,HttpStatusCode,ResponseHeaders);
When I call this method I get the error message" Authentication failed because the remote party has closed the transport stream."
I've searched a little more and developed an dll and consumed on NAV.
The dll code is something like this
public void GetConsent(string pChannelId, string pChannelValue)
{
string Url = GetConsentUrl + HashToken + "?idClient=" + IdClient + "&idChannel=" + pChannelId + "&channelValue=" + pChannelValue;
WebRequest webRequest = WebRequest.Create(Url);
WebResponse webResponse = webRequest.GetResponse();
Stream responseStream = webResponse.GetResponseStream();
XmlDocument XmlDoc = new XmlDocument();
XmlDoc.Load(responseStream);
}
Now the "funny thing" is that when I run this methode on Visual Studio it wotks fine and I can get a corret answer and load the responsestream.
On other hand when I publish my dll and try to call it form NAV I get the same error message "...Authentication failed because the remote party has closed the transport stream."
Can anyone has an idea why its does not work on NAV?
My customer uses NAV2017 version and wants to call a "webservice" published by a parter and this webservice uses Post and Get methods.
I've searched and tried to use standard codeunit 1297 and my code was something like this:
ltxtUrl := STRSUBSTNO(STRSUBSTNO(ltxtAddress,'1',pRecContact."E-Mail"));
lCduHttpWebRequestMgt.Initialize(ltxtUrl);
lCduHttpWebRequestMgt.DisableUI;
lCduHttpWebRequestMgt.SetMethod('GET');
lCduHttpWebRequestMgt.SetReturnType('application/xml');
lCduHttpWebRequestMgt.SetContentType('application/xml');
lCduHttpWebRequestMgt.GetResponse(lInStreamResponse,HttpStatusCode,ResponseHeaders);
When I call this method I get the error message" Authentication failed because the remote party has closed the transport stream."
I've searched a little more and developed an dll and consumed on NAV.
The dll code is something like this
public void GetConsent(string pChannelId, string pChannelValue)
{
string Url = GetConsentUrl + HashToken + "?idClient=" + IdClient + "&idChannel=" + pChannelId + "&channelValue=" + pChannelValue;
WebRequest webRequest = WebRequest.Create(Url);
WebResponse webResponse = webRequest.GetResponse();
Stream responseStream = webResponse.GetResponseStream();
XmlDocument XmlDoc = new XmlDocument();
XmlDoc.Load(responseStream);
}
Now the "funny thing" is that when I run this methode on Visual Studio it wotks fine and I can get a corret answer and load the responsestream.
On other hand when I publish my dll and try to call it form NAV I get the same error message "...Authentication failed because the remote party has closed the transport stream."
Can anyone has an idea why its does not work on NAV?
0
Answers
-
Hi, can you try to execute DLL via nav 2018 for example.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions