MTOM Soap12 Send Request got 500 issue in C# window application
In soap UI tools MTOM first part XML able to send got 200 success reply from state same things implemented in C# window application got 500 issue below mention tried sample code
eAttachment eAttachments = new eAttachment(); // Proxy Class Name
eAttachments.Url = "https://dptng.njcourts.gov:2094/prweb/PRSOAPServlet/SOAP/MunicipalDocUpload/Services";
eAttachments.RequireMtom = true; //Enable MTOM property
UsernameToken userToken = new UsernameToken(textBox3.Text, textBox4.Text, PasswordOption.SendPlainText); // User Name and Password
SoapContext requestContext = eAttachments.RequestSoapContext;
//SoapContext resContext = eAttachments.ResponseSoapContext;
requestContext.Security.Tokens.Add(userToken);
eAttachments.SoapVersion = SoapProtocolVersion.Soap12;
objUploadImageRequestType.VendorId = "PHOENIX"; //
objUploadImageRequestType.ApplicationId = "ESUMMONS"; //
CaseData.CourtCode = "0811";
CaseData.Prefix = "S24";
CaseData.Year = "2024";
CaseData.SequenceNumber = "000005";
CaseData.AgencyId = "0811";
CaseData.UpdateImage = "N";
objUploadImageRequestType.CaseData = CaseData;
objUploadImageResponseType = eAttachments.UploadImage(objUploadImageRequestType); // Send Soapenvelope request Data to state got 500 issue
Please help how to send MTOM first level part request in C# using soap 12 version
Hi samsudeen04
To resolve the 500 error, follow the below and see if it solves your issue.
Ensure that MTOM is properly configured on the eAttachments object. Verify that the RequireMtom property is set to true. Additionally, confirm that the server you're connecting to supports MTOM with SOAP 1.2, as some servers may have limitations, also Review server logs on the service to access detailed error messages
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards