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 611829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:49:35+00:00 2026-05-13T17:49:35+00:00

I’m having an issue with trying to use VB.NET and the WebRequest object to

  • 0

I’m having an issue with trying to use VB.NET and the WebRequest object to post some cXML text and an attachment. I believe I am formatting the text of the data I wish to post correctly, as it matches samples Ariba has supplied.

What I am uncertain of is if I am correctly using the WebRequest object to do the posting. I am setting the Method as "POST" and the ContentType as "multipart/mixed". I can successfully post cXML (using a ContentType of "text/xml"), so I know posting in general works.

The message I get back from Ariba is:

The document could not be parsed: Missing start boundary [ANCLS-741552]

However, as the following code shows, there is a start boundary. I have removed some proprietary data and replaced it with "…". Following the MIME text, I have included the relevant VB.NET code I am using.

Any and all suggestions are most welcome and appreciated!

------=_boundary.20100210154837663.173702
Content-Type: text/xml; charset=UTF-8
Content-ID: Part1.5213.20100210154837663.319349

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.018/cXML.dtd">
<cXML.../cXML>

------=_boundary.20100210154837663.173702
Content-Type: application/octet-stream
Content-transfer-encoding: base64
Content-ID: 5213.20100210154837663.319349
Content-Disposition: attachment; filename=attachment_20100210154837663_125705.jpg
Content-Length: 5660

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAd
.
.
.
dC2Nz9dOaQ1ZVIilwIpaWvLEg7aWuauv/9k=
------=_boundary.20100210154837663.173702--


Dim myWriter As StreamWriter = Nothing

Dim strUri As String = "https://service.ariba.com/service/transaction/cxml.asp"

Dim WebReq As WebRequest = System.Net.WebRequest.Create(strUri)

WebReq.Method = "POST"
WebReq.ContentType = "multipart/mixed"

myWriter = New StreamWriter(WebReq.GetRequestStream())
myWriter.Write(xmlText)
myWriter.Close()

Dim WebRsp As HttpWebResponse
WebRsp = CType(WebReq.GetResponse(), HttpWebResponse)
  • 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. Editorial Team
    Editorial Team
    2026-05-13T17:49:36+00:00Added an answer on May 13, 2026 at 5:49 pm

    Bill – I got some info from Ariba and thought it might be useful to you:

    • The Content-type declaration for the whole payload specifies the boundary
    • Each part is preceded w/ a ‘–‘ followed by the boundary
    • The document terminates with a ‘–‘ followed by boundary followed by ‘–‘
    • The Content-ID of each part is enclosed in angle brackets
    • The Content-ID of the attachment is referenced in the URL element in Comments/Attachment w/o angle brackets

    Maybe you could try with a shorted boundary string. Also, note the ‘start’ parameter. Here’s the one that worked for me:

    request.ContentType =  "multipart/related;boundary=outerboundary1;type=""text/xml"";start=""<x.xml>"""
    

    A sample XML with the above boundary & start settings looks like this:

    --outerboundary1
    
    Content-Type: text/xml
    
    Content-ID: <x.xml>
    
    <?xml version="1.0"?>
    
    <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.007/InvoiceDetail.dtd">
    
    <cXML payloadID="za1saasxsx" timestamp="2003-04-04" xml:lang="en"><Header><From> 
    
    ... 
    
    <Comments>These also use bluetooth<Attachment><URL>cid:xx@cxml.org</URL></Attachment></Comments>
    
    ...
    
    </Request></cXML>
    
    --outerboundary1
    
    Content-type: text/plain; charset=US-ASCII
    
    Content-Disposition: attachment; filename=PremiereCatalog.xxx
    
    Content-Length: 4
    
    Content-ID: <xx@cxml.org>
    
    xxxx
    
    --outerboundary1-- 
    

    I know it can be very frustrating with very little help out there. So lemme know if you need the complete code that worked for me.

    Pravin

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into

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.