Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 183129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:03:40+00:00 2026-05-11T15:03:40+00:00

I have to invoke a web service with a single parameter, a String in

  • 0

I have to invoke a web service with a single parameter, a String in XML format. I’m building this via an XSLT transformation. So far so good.

The problem is with this XSD fragment:

<xs:complexType name='Document'>     <xs:sequence>         <xs:element name='title' type='xs:string' minOccurs='1'/>         <xs:element name='content' type='xs:base64Binary' minOccurs='1'/>     </xs:sequence> </xs:complexType> 

which translates (for example) into this XML:

<attachment>     <title>test title</title>     <content>               PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Inllc     yI/Pg0KPG1zZ3ByYXRpY2E+DQogICAgPHByYXRpY2E+DQogICAgICAgIDxwcm9jZXNzbz     4NCiAgICAgICAgICAgIDxjb2RQcm9jZXNzbz4xPC9jb2RQcm9jZXNzbz4NCiAgICAgICA     gICAgIDxjb2RJc3RhbnphUHJvY2Vzc28MzwvY29kSXN0YW56YVByb2Nlc3NvPg0KICAgI     CAgICAgICAgPGNvZFN0YXRvPjYwPC9jb2RTdGF0bz4NCiAgICAgICAgPC9wcm9jZXNzbz     4NCiAgICA8L3ByYXRpY2E+DQo8L21zZ3ByYXRpY2E+     </content> </attachment> 

Yes, you got it right: I have to insert a file content into the XML document in base 64 binary format.

I thought about inserting a placeholder with XSLT and then processing the XML document to replace it with the actual file content, but I’m wondering if there are any best practices for these occasions, maybe some fancy XSTL trick well beyond my knowledge or some Java tools which may come in handy.

How would you do that?

NOTE: I can’t use SOAP with attachment, and I’m well aware that the aforementioned approach is prone to failure in case of huge attachments, but at the moment our counterpart will not budge.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:03:41+00:00Added an answer on May 11, 2026 at 3:03 pm

    Probably the best way to do this is to read the file and encode its contents in base64 by the code that instantiates the XSLT transformation. The base64 string can either be passed as a parameter to the transformation, or the transformation could request it via an extension method.

    In principle XSLT could be used to do the encoding to base64, however some byte values, such as 0 (for XML 1.0 and XML 1.1), and 29 other codes below 0x20 (for XML 1.0) are forbidden as characters within an XML document and this makes such encoding in XSLT impossible.

    ( see: http://projects.ischool.washington.edu/tabrooks/545/ContentManagement/PassingParameters.htm )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 117k
  • Answers 117k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well basically I wanna have a back up of my… May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer The proper way to do so is: FileOutputStream out =… May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer If you're using XHTML5, then you don't need to include… May 11, 2026 at 10:50 pm

Related Questions

(Edited to add an example and hopefully make it a bit clearer) I'm mainly
I am writing a C# client that calls a web service written in Java
I have a web application uses a proxy to invoke an operation on a
We're using CruiseControl.NET which invokes an MSBuild script. While debugging the build script, we

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.