Jump to content

Recommended Posts

Posted

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...