Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

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

(0) ShareShare
ReportReport
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
    233,013 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans