Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POX Reader can't handle base64 binary (HakanL) #2

Open
mikeobrien opened this issue Aug 11, 2010 · 7 comments
Open

POX Reader can't handle base64 binary (HakanL) #2

mikeobrien opened this issue Aug 11, 2010 · 7 comments

Comments

@mikeobrien
Copy link
Owner

The POXXmlReader is passing some requests down to the XmlReader/XmlDictionaryReader and intercept others with its XmlNodeReader through the property Reader. I ran into an issue where the POX reader couldn't deal with base64 binary data, even if its Reader could. The framework calls ReadObject and when the stream contains base64 data it throws a NotSupported exception. But if I check the XmlNodeReader that the POX is using for most of the methods, then it works. But ReadContentAsBase64 is not intercepted and is then passed down to XmlDictionaryReader, which cannot handle base64 binary.

I've attached a patch that implements a base64 handler for the POX reader.

@BabelFish80
Copy link

where is the patch?

@HakanL
Copy link
Contributor

HakanL commented Oct 26, 2010

The patch was attached to the issue in codeplex, I'm trying to figure out how I can attach the patch on github.

@HakanL
Copy link
Contributor

HakanL commented Oct 26, 2010

I'm not sure if I did this right, but I created a fork where I applied my patch: http://github.com/HakanL/WcfRestContrib/commit/608d0c1f804e5bfd8159feae6645ed1bc8391bc7

@BabelFish80
Copy link

ahh CanReadBinaryContent, that is what i forgot. yeah, I need to figure how to checkout/checkin changes so I can upload my additions as well.thanks!

@BabelFish80
Copy link

that fix didnt seem to resolve my issue. I am still getting the error "The request body could not be deserialized. 'EndElement' 'FileContents' from namespace '' is not expected. Expecting element '__identity'." I have a datacontract that contains a memorystream datamember. the parser cant seem to parse the data. the normal DataContract parser works fine though. any thoughts?

@HakanL
Copy link
Contributor

HakanL commented Oct 26, 2010

I don't think pox will handle memorystream directly, I think you need to use byte[] in your contract. You should get down to the bare minimums in your contract.

@HakanL
Copy link
Contributor

HakanL commented Nov 3, 2010

This is applied to the trunk now, yea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants