Calling a werbservice method to upload a file to the platform

Calling a werbservice method to upload a file to the platform

Hello folks.
I’m struggling to call a SOAP webservice from a mobile application to send a picture file (Base64 format) to the Outsystems platform, and I’m wondering if somebody can help me to identify what I’m doing wrong.
I have called several other webservices that are working properly, but none of them is related to sending a file to the platform, what evidences the problem comes from the fact that I’m not being able to manage the image file. When I call the webservice it doesn’t achieve the platform (I don’t receive anything in the debug) and I get the “Error 500 - Bad Request” as a response.
In case it ca be helpful, please find below the source code related to the webservice call.
Kind regards,

function receiptUpload(){  
         var productServiceUrl = "";
        var xmlmessage =  
            "<?xml version=\"1.0\" encoding=\"utf-8\"?>"+
            "<soap:Envelope xmlns:xsi=\"\" xmlns:xsd=\"\" xmlns:soap=\"\">"+
                "<ReceiptUpload xmlns=\"\">"+
            url: productServiceUrl,
            type: "POST",
            dataType: "xml",
            data: xmlmessage,
            complete: receiptReturn,
            contentType: "text/xml; charset=\"utf-8\""
Hello Rafael,

The Bad Request error is usually an HTTP error code 400, and not 500. This suggest that this is not a problem in the HTTP layer, but in the payload.

A rapid analysis, shows a missing '<' in the EntityPassword element. However, it's possible that something else is missing.

My suggestion is to use a tool like SOAP UI to test the web service, and get the request XML. You can then use this in your code.

Hopw this informaiton is helpful.

Thanks a lot Miguel.

I'll check and work on your tips and let you know how they worked. I hope to come back with great news.