Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Help, pass base64binary data to server failed.

$
0
0

Hi Guys,

I need to upload a image binary data to server using a web service API generated from wsdl file. I read the byte[] from image file, and passed it to the web service API, then the API throwed an exception said "System.Web.Services.Protocols.SoapException: For input string: ' [here is the base64binary string for my image file] ' ". This issue draged me crazy, can anyone help me out?

Here is web service API define:

public BaseWSDto uploadImage([System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", IsNullable=true)] byte[] imageByteArray) {

    object[] results = this.Invoke("uploadImage", new object[] {imageByteArray});

    rturn (BaseWSDto)results[0];

}

Here is how I call the API:

FileStream fs = new FileStream(imageFile, FileMode.Open, FileAccess.Read);

byte[] buffer = new byte[fs.Length];

fs.Read(buffer, 0, Convert.ToInt32(fs.Length));

BaseWSDto result = client.uploadImage(buffer);


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>