title: Uploading Image to server with SOAP webservice
body: <p>I get an error saying "Server was unable to process request. ---> Instance failure." when I try to upload an image with SOAP webservice. </p>
  
  <p>Please help as I'm stuck here.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>private class UploadImage extends AsyncTask&lt;String, Void, String&gt; {
      @Override
      protected void onPreExecute() {
          progressDialog = new ProgressDialog(UploadImageActivity.this);
          progressDialog.setIndeterminate(false);
          progressDialog.setCancelable(false);
          progressDialog.setMessage("Please wait..");
          progressDialog.show();
      }
  
      @Override
      protected String doInBackground(String... params) {
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          bitmap.compress(Bitmap.CompressFormat.PNG, 90, baos);
          //bMap is the bitmap object
          byte[] imagebyte = baos.toByteArray();
  
          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);          
          request.addProperty("Email", UserContext.email);
          request.addProperty("MobileNo", UserContext.mobilenumber);
          request.addProperty("Image", imagebyte);
          request.addProperty("Flage_InsertiedBy", UserContext.Flage_InsertiedBy);
  
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envelope.dotNet = true;
          envelope.setOutputSoapObject(request);
          new MarshalBase64().register(envelope);
  
          HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
          try {
              androidHttpTransport.call(SOAP_ACTION, envelope);
              SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
              webResponse = response.toString();
              System.out.println("test response upload " + webResponse);
          } catch (Exception e) {
              System.out.println("test response upload ex " + e.getMessage());
          }
          return webResponse;
      }
  
      @Override
      protected void onPostExecute(String result) {
          progressDialog.dismiss();
      }
  </code></pre>