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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:10:02+00:00 2026-06-10T07:10:02+00:00

I have the following SOAP response: <?xml version=1.0?> <env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/> <env:Header/> <env:Body> <GetSalesResponse xmlns=http://api.dgm-uk.com/Publisher/schemas>

  • 0

I have the following SOAP response:

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>  
<GetSalesResponse xmlns="http://api.dgm-uk.com/Publisher/schemas">
<status>ok</status>
-<sales>
     -<sale>
      <saleid>***</saleid>
      <campaignname>***</campaignname>
      <campaignid>***</campaignid>
      <advertisername>***</advertisername>
      </sale>
      -<sale>
      <saleid>***</saleid>
      <campaignname>***</campaignname>
      <campaignid>***</campaignid>
      <advertisername>***</advertisername>
      </sale> 
      ..............etc

Now, I was able to get all the sale elements using this code:

XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlFile.NameTable);
nsmgr.AddNamespace("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
nsmgr.AddNamespace("GSR", "http://api.dgm-uk.com/Publisher/schemas");
var items = xmlFile.DocumentElement.SelectSingleNode("/soapenv:Envelope/soapenv:Body/GSR:GetSalesResponse/GSR:sales", nsmgr);

How can I then while iterating the sale elements, select their inner children like saleid and campaignid? I just can’t select them

  • 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-06-10T07:10:04+00:00Added an answer on June 10, 2026 at 7:10 am

    This works…

    XElement doc = XElement.Load("c:\\dd.xml");
    XNamespace ns1 = "http://schemas.xmlsoap.org/soap/envelope/";
    XNamespace ns2 = "http://api.dgm-uk.com/Publisher/schemas";
    
    var items = doc.Descendants(ns1 + "Body").Descendants(ns2 + "GetSalesResponse").Descendants(ns2 + "sales").Descendants(ns2 + "sale")
    .Select((x) => new
    {
    saleid = x.Element(ns2 + "saleid").Value,
    campaignname = x.Element(ns2 + "campaignname").Value,
    campaignid = x.Element(ns2 + "campaignid").Value,
    advertisername = x.Element(ns2 + "advertisername").Value
    });
    
    foreach (var itm in items)
    {
    Console.WriteLine("saleid:" + itm.saleid);
    Console.WriteLine("campaignid:" + itm.campaignid);
    Console.WriteLine("campaignname:" + itm.campaignname);  
    Console.WriteLine("advertisername:" + itm.advertisername);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XML : <s:Envelope xmlns:s=http://schemas.xmlsoap.org/soap/envelope/> <s:Body> <GetCustomerCentreDetailsResponse xmlns=http://tempuri.org/> <GetCustomerCentreDetailsResult xmlns:i=http://www.w3.org/2001/XMLSchema-instance xmlns:a=http://schemas.datacontract.org/2004/07/*****>
I have a soap request returning a response like below: <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
I have the following XML: <Result ID=1,New xmlns=http://schemas.microsoft.com/sharepoint/soap/> <ErrorCode>0x00000000</ErrorCode> <ID /> <z:row ows_ID=6 />
I have an XML/Soap file that looks like this: <?xml version=1.0 encoding=utf-8?> <soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope
I have an SOAP response that looks similar to this: <?xml version=1.0 encoding=UTF-8?> <soapenv:Envelope
I have the following code: $body = <SOAP-ENV:Envelope>.$data.</SOAP-ENV:Envelope>; $ch = curl_init($FD_Add); curl_setopt($ch, CURLOPT_POST, 1);
I have following plist: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
I have the following string loaded to an XML document: <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope
I have following fiddle: http://jsfiddle.net/BFSH4/ As you see there are two issues: The h1
I need to generate the following XML with SOAP: ... <InternationalShippingServiceOption> <ShippingService>StandardInternational</ShippingService> <ShippingServiceCost currencyID=USD>39.99</ShippingServiceCost>

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.