Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Passing Strings encoded BASE64 in XML

Passing Strings encoded BASE64 in XML

Scheduled Pinned Locked Moved XML / XSL
questionxmlhelp
2 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I want to use XML to transport some data across HTTP protocol. When text in some element contains US ASCI characters then all is OK. But when some language- specific characters appear i get error. I want to encode contents of some elements (these that contain these unfortunate characters) to BASE.64. when I do the following, I get error. _variant_t var_val=GetSomeText_WithStrangeChars() ..check errorcodes... pNewNodeOut->put_dataType(L"bin.base64"); ..check errorcodes... //ok it works so far pNewNodeOut->put_nodeTypedValue(var_val); //HERE CRASH //It is here where HRESULT is E_FAIL The first question is: What to do to avoid error, and to sucessfully put value of _variant_t (containing BSTR) into element whose type is set to bin.base64 ? The last question is: Shall I be able to automatically get the value of the element without explicit converting it from BASE.64 ? I mean : Shall MSXML parser do the conversion automatically for me when I will call nodeTypedValue property ? Thanks Michal Januszczyk

    A 1 Reply Last reply
    0
    • L Lost User

      I want to use XML to transport some data across HTTP protocol. When text in some element contains US ASCI characters then all is OK. But when some language- specific characters appear i get error. I want to encode contents of some elements (these that contain these unfortunate characters) to BASE.64. when I do the following, I get error. _variant_t var_val=GetSomeText_WithStrangeChars() ..check errorcodes... pNewNodeOut->put_dataType(L"bin.base64"); ..check errorcodes... //ok it works so far pNewNodeOut->put_nodeTypedValue(var_val); //HERE CRASH //It is here where HRESULT is E_FAIL The first question is: What to do to avoid error, and to sucessfully put value of _variant_t (containing BSTR) into element whose type is set to bin.base64 ? The last question is: Shall I be able to automatically get the value of the element without explicit converting it from BASE.64 ? I mean : Shall MSXML parser do the conversion automatically for me when I will call nodeTypedValue property ? Thanks Michal Januszczyk

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Passing binary or base64 information around may be easiest if you use SOAP - here is information on building a SOAP tool in VC: C++ SOAP client for MS SOAP Toolkit 1.0

      For more basic non-VC :zzz: introductory base64 information try this XML and Binary Data article and MXSML based class module to perform Base64 encoding and decoding and Class object for Base64 conversion with .NET

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups