I have an issue..
I am passing the image as the parameter to my webservices that is being build on .NET, but it returns me the error from the webservices. I am not been able to understand y this is happening.
This is my function in Android thru which I call the webservices.
public ArrayList<String> HttpClient(String oid,String Base64)
{
SoapObject Request=new SoapObject(NAMESPACE,METHOD_NAME);
Request.addProperty("oid",oid);
Request.addProperty("base64",Base64.replaceAll("/","#"));
SoapSerializationEnvelope soapEnvelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet=true;
soapEnvelope.setOutputSoapObject(Request);
AndroidHttpTransport aht=new AndroidHttpTransport(URL);
try
{
aht.call(SOAP_ACTION,soapEnvelope);
resultString = (SoapPrimitive) soapEnvelope.getResponse();
System.out.println(resultString.toString());
}
And this is my function in webservices that is in C#.NET
[WebMethod]
public void UpdateImage2Database_FromBase64String(string base64, int oid)
{
try
{
SqlConnection conn = new SqlConnection(cConnectionString);
try
{
conn.Open();
//SqlCommand cmd = new SqlCommand("Update CCOD_ORDERHDR" +
// " SET FLD_ORDERHDR_IMAGECAPTURE=@FLD_ORDERHDR_IMAGECAPTURE" +
// " Where FLD_ORDERHDR_ID=" + oid,
// conn);
SqlCommand cmd = new SqlCommand("Update CCOD_ORDERHDR" +
" SET FLD_ORDERHDR_IMAGECAPTURE='" + base64 + "' Where FLD_ORDERHDR_ID=" + oid,
conn);
//cmd.Parameters.Add("@FLD_ORDERHDR_IMAGECAPTURE", image);
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
}
catch (Exception ex)
{
throw ex;
}
}
datatype in my database is text.
please help me.
Any suggestions will be accepted.
Thanks