Forum Discussion

samsudeen04's avatar
samsudeen04
New Contributor
7 months ago

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

  • Humashankar's avatar
    Humashankar
    Champion Level 3

    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

    • samsudeen04's avatar
      samsudeen04
      New Contributor

      Hi HumasShankar,

      Thanks for your information , i am able to communicate using soap 1.2 version in soap tools itself only facing issue in code level.

      eAttachments  object property has "RequireMtom"  only dont has any other details so  Can you tell how to send PDF data as MTOM format using 1.2 soap vesion.

      I am using C# window application for send PDF data as MTOM format is it possible or not if it possible can you tell the some idea to implement the MTOM in C# windows application.

       

      • samsudeen04's avatar
        samsudeen04
        New Contributor

        Hi HumasShankar,

        How to resolve WSE839 error i have attached screenshot for this issue related please find it and shortly give solution.