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

  • SEARCH
  • Home
  • 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 6764341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:34:57+00:00 2026-05-26T14:34:57+00:00

Not even sure if I’m asking the right question, but here it goes. Basically

  • 0

Not even sure if I’m asking the right question, but here it goes. Basically because of a lack of support of the WCF DS client for “OData deep inserts” I’m having to manually build up an Atom request. I have the request nearly complete, the only thing that is missing (and it causing a problem on the request to the server) is add the namespace prefix to the “entry” node in the XML request.

I’m using a SyndicationItem to build the request up. I need to prefix the “entry” node with “atom:” for the server to accept the request…

Any help is much appreciated. Here is the request that is being generated now:

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <atom:id>uuid:8ed93950-9c16-4923-b6cc-ca5c7d020709;id=1</atom:id>
  <atom:title type="text"></atom:title>
  <atom:updated>2011-11-03T23:02:40Z</atom:updated>
  <atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesOrderItems" type="application/atom+xml;type=feed" title="SALES_ORDER.SalesOrderHeader_SalesOrderItemsx" href="SalesOrderHeaders()/SalesOrderItems">
    <m:inline>
      <atom:feed>
        <atom:entry>
          <atom:content>
            <m:properties>
              <d:Item>10</d:Item>
              <d:Material>70000559</d:Material>
              <d:Plant>570B</d:Plant>
              <d:Quantity>10</d:Quantity>
            </m:properties>
          </atom:content>
        </atom:entry>
        <atom:entry>
          <atom:content>
            <m:properties>
              <d:Item>20</d:Item>
              <d:Material>70000559</d:Material>
              <d:Plant>570B</d:Plant>
              <d:Quantity>10</d:Quantity>
            </m:properties>
          </atom:content>
        </atom:entry>
      </atom:feed>
    </m:inline>
  </atom:link>
  <atom:content type="text/xml">
    <m:properties>
      <d:DocumentType>ZCSH</d:DocumentType>
      <d:CustomerId>0001008657</d:CustomerId>
      <d:SalesOrg>1100</d:SalesOrg>
      <d:DistChannel>10</d:DistChannel>
      <d:Division>40</d:Division>
    </m:properties>
  </atom:content>
</entry>

And here is the code I have right now to generate the request. This is just a proof of concept, so please ignore the crap. 🙂

XNamespace nsAtom = "http://www.w3.org/2005/Atom";
            XNamespace nsD = "http://schemas.microsoft.com/ado/2007/08/dataservices";
            XNamespace nsM = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";

            SyndicationItem soHeader = new SyndicationItem();

            soHeader.AttributeExtensions.Add(new XmlQualifiedName("atom", XNamespace.Xmlns.ToString()), nsAtom.NamespaceName);
            soHeader.AttributeExtensions.Add(new XmlQualifiedName("d", XNamespace.Xmlns.ToString()), nsD.NamespaceName);
            soHeader.AttributeExtensions.Add(new XmlQualifiedName("m", XNamespace.Xmlns.ToString()), nsM.NamespaceName);


            soHeader.Content = SyndicationContent.CreateXmlContent(
                new XElement(nsM + "properties",
                    new XElement(nsD + "DocumentType", "ZCSH"),
                    new XElement(nsD + "CustomerId", "0001008657"),
                    new XElement(nsD + "SalesOrg", "1100"),
                    new XElement(nsD + "DistChannel", "10"),
                    new XElement(nsD + "Division", "40")
                    )
                );

            SyndicationLink link = SyndicationLink.CreateAlternateLink(new Uri("SalesOrderHeaders()/SalesOrderItems", UriKind.Relative), "application/atom+xml;type=feed");
            link.Title = "SALES_ORDER.SalesOrderHeader_SalesOrderItems";
            link.RelationshipType = "http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesOrderItems";
            soHeader.Links.Add(link);

            XElement items = new XElement(nsM + "inline",
                                new XElement(nsAtom + "feed")
                                    );

            for (int i = 0; i < 2; i++)
            {
                items.Element(nsAtom + "feed").Add(new XElement(nsAtom + "entry",
                            new XElement(nsAtom + "content",
                                new XElement(nsM + "properties",
                                    new XElement(nsD + "Item", ((i+1)*10).ToString()),
                                    new XElement(nsD + "Material", "70000559"),
                                    new XElement(nsD + "Plant", "570B"),
                                    new XElement(nsD + "Quantity", (Decimal)10.0)
                                    )
                                )
                            )
                        );
            }

            link.ElementExtensions.Add(items);

            XmlWriter xml = XmlWriter.Create("C:\\test.xml");            
            soHeader.SaveAsAtom10(xml);
            xml.Close();
  • 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-26T14:34:58+00:00Added an answer on May 26, 2026 at 2:34 pm

    The entry element is in the ATOM namespace as it should be, it’s just not using any prefix. If you remove the namespace declaration of atom prefix you’re adding manually, all the ATOM elements will be in the ATOM namespace still, but without the atom prefix. Note that the entry elements declares the default namespace to be ATOM namespace.
    Any XML compliant server should be able to read this payload. Removing the atom prefix will just make the payload smaller.

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

Sidebar

Related Questions

I'm not even sure how to begin wording this question, but basically, I have
I'm not even sure this is entirely programming related...but here goes: I need to
Not even sure I'm stating the question correctly. Here's the situation. I have a
I'm not even sure if versioning is the right word for it, but it'll
I'm not even sure this is possible to do efficiently, but here's my problem:
I have a question regarding UILabels. I'm not even sure it is the right
I'm sorry if this question has been asked before, but I'm not even sure
I'm sad to have to ask this question, but I'm not even sure of
Not even sure if this is the right way to title the question. I
I'm not even sure this is the right way to do this, but I

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.