Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Exception thrown: 'System.Net.WebException' in System.Web.Services.dll

Posted on by 160

Hi!:

I had an error, CLRInterop in Ax 2,009 calling a C# class.

Now, I don't have the issue in Ax.

But, in the C# class, I get this message calling the send method

(user, password and class with document).

public class Send
{
    public String returnValue;
public String SendDocument(String _User, String _Password, DocumentoElectronico documentoElectronico) { System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; AXV5ElectronicInvoice.WebService.Service service = new Service(); System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; try { EnviarResponse enviarResponse = new EnviarResponse(); var responseCode = service.Enviar(_User, _Password, documentoElectronico); returnValue = responseCode.ToString();  return returnValue; } catch(Exception ex)         { returnValue = ex.Message; return returnValue;         } } }
What can be wrong?. The site only ask for user, password and class instance.



  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Exception thrown: 'System.Net.WebException' in System.Web.Services.dll

    You mentioned the the type of the exception, but nothing more. Please tell us what the message says, what is the value of the StackTrace property, and if there is an InnerException, share its details too.

    Trying to find a solution without knowing what error we got is close to impossible.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans