Getting Bytes represented by array of strings

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
Background:
Our app is C#. We're getting data from a Java app thru an Axis2 web service. We don't control the Java/Axis2 end.

The WSDL declares one field as < xs : element name= "bytes" nillable="true" type="xs : base64Binary" / >
which should be an array of bytes, representing a PDF.

When we try to read it as ba se64Bin ary, we get an error trying to deserialize. (See this post: http://channel9.msdn.com/ShowPost.aspx?PostID=393100)

If you view the service through a browser and pass valid data you get something like this:
- < attachments xmlns = "http : //webservices. server.ecers.branaghgroup . com/xsd" >
* 37
* 80
* 68
* 70
* 45
* 49
* 46
* 52
* 10
* 37
* -30
* -29
* -49
* -45
* 10
* 52
* 32
* 48
* 32
* 111


If I change my local WSDL to do an array of strings like this
< xs : element maxOccurs="unbounded" name="bytes" nillable="true" type="xs : string" / >
I get an array of strings:
37,80,68,70,45,49,46,52,10,37,-30,-29...

Questions:
1) As a workaround, I'm getting the data into my app with the string method. Could I get that turned into my bytes that I could stream to a file or save in an SQL database?

Encoding to byte would take 37 and give me the bytes for that string, not a byte of 37.

2) Am I getting the deserialization issue because I'm not getting 0037, 0080, 0068...?



More...

View All Our Microsoft Related Feeds
 
Back
Top