IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Base64 Validation Options · View
IrishStout
Posted: Thursday, October 30, 2014 1:21:54 PM
Rank: Advanced Member

Joined: 5/26/2011
Posts: 31
Location: Ottawa
Hi Everyone,

I am receiving XML files with a base64 tag that contains very large .pdf files. I am trying to validate if these entries are valid or not.
Is there a way to do this in mapforce? Or a way to detect if the content of the encode data is corrupt?

I would supple an example but the data is sensitive..

Can you please supply me the correct function? This is time sensitive and I am having issues.
The data appears to be correct but when I load in my importer and through the schema checker it is reporting as none valid?

Thanks for any help or suggestions,

island
Posted: Thursday, October 30, 2014 6:47:48 PM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
The following images represent a mapping which maps an invalid base64binary value in the source to a target text component. As you can see, when you provide the xml instance file for the source xsd component you will see an error in the messages window at the bottom, and when you try to switch to the output preview you will also see an error that the value could not be converted to base64binary. How are you executing the mapping?

File Attachment(s):
test.zip (2kb) downloaded 316 time(s).

island attached the following image(s):
map.png
map_preview.png

IrishStout
Posted: Friday, October 31, 2014 5:36:09 PM
Rank: Advanced Member

Joined: 5/26/2011
Posts: 31
Location: Ottawa
So the client sent me XML files. I have the .xsd provided, from the Professional Medical Body. The XML files adhere to the .xsd.
In mapforce I have the left side being the sent file and connecting to the right .xsd. Hoping to copy the information provided into the new xml file after applying some transformation. One of the items I want to check is the base64 field to make sure it conforms to base64.
I am using C# as my base language.

Not sure if that explains what you meant?

The specific tag looks like this <ReportsReceived><Content><Media>JUHYSTHJDJF+/03kdi4521....==</Media></Content><ReportsReceived>
I want to validate that the information in the tag adheres to base64 format and is a proper image file.

thanks for the reply Island :)
island
Posted: Thursday, November 6, 2014 9:02:43 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Hi,

if I understand it correctly you are generating c# code from your mapping which you then compile and run, and you want to validate the xml source file of your mapping.

I attached an example mapping in my last post. If you generate c# code from it, compile and run it an exception will be thrown:

Mapping Application
ERROR: Invalid character in a Base-64 string.

Is this not what you are looking for?


Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.