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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:36:23+00:00 2026-05-25T22:36:23+00:00

Let’s say I’ve got a web service response which looks like this: <soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/

  • 0

Let’s say I’ve got a web service response which looks like this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <PMWSGetReportResponse xmlns="http://localhost/PCMilerWS/">
      <PMWSGetReportResult>
        <ReportResponse>
          <Version>25.02</Version>
          <Report>
            <RptType>m</RptType>
            <TripID>011535</TripID>
            <StopNum>1</StopNum>
            <MilesReport>
              <StpLineType>
                <SRStop>
                  <Region>NA</Region>
                  <Address1 />
                  <City>Mill Valley</City>
                  <State>CA</State>
                  <Zip>94941</Zip>
                  <Juris>Marin</Juris>
                  <Lat>37894200</Lat>
                  <Long>-122493488</Long>
                </SRStop>
                <LMiles>0.0</LMiles>
                <TMiles>0.0</TMiles>
                <LCostMile>0.00</LCostMile>
                <TCostMile>0.00</TCostMile>
                <LHours>0:00</LHours>
                <THours>0:00</THours>
                <LTolls>0.00</LTolls>
                <TTolls>0.00</TTolls>
                <LEstghg>0.0</LEstghg>
                <TEstghg>0.0</TEstghg>
              </StpLineType>
              <StpLineType>
                <SRStop>
                  <Region>NA</Region>
                  <Address1 />
                  <City>San Francisco</City>
                  <State>CA</State>
                  <Zip>94109</Zip>
                  <Juris>San Francisco</Juris>
                  <Lat>37790599</Lat>
                  <Long>-122418809</Long>
                  <StopWarning>False</StopWarning>
                </SRStop>
                <LMiles>13.2</LMiles>
                <TMiles>13.2</TMiles>
                <LCostMile>34.33</LCostMile>
                <TCostMile>34.33</TCostMile>
                <LHours>0:17</LHours>
                <THours>0:17</THours>
                <LTolls>12.50</LTolls>
                <TTolls>12.50</TTolls>
                <LEstghg>48.7</LEstghg>
                <TEstghg>48.7</TEstghg>
              </StpLineType>
            </MilesReport>
          </Report>
        </ReportResponse>
      </PMWSGetReportResult>
    </PMWSGetReportResponse>
  </soap:Body>
</soap:Envelope>

I’ve been trying to use Linq to XML to retrieve, say, the list of all StpLineType nodes.
I’ve tried doing so with something like:

XDocument xdoc = XDocument.Load(new StringReader(soapResponse));
var results = xdoc.Descendants("StpLineType");

But nothing is returned. I can see that the document is loaded into xdoc, but I can’t seem to correctly query it. FWIW, I’ve also tried:

XDocument xdoc = XDocument.Load(new StringReader(soapResponse));
XNamespace ns = "soap";
var results = xdoc.Descendants(ns + "StpLineType");

Just in case the namespace was causing the problem – no luck.

What am I missing?

  • 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-25T22:36:23+00:00Added an answer on May 25, 2026 at 10:36 pm

    You’re ignoring the two XML namespaces on this document!

    • The root level and the <body> tag are in the soap namespace
    • the rest of the document is in the “default” namespace (without prefix) defined on the <PMWSGetReportResponse> element

    If you take that into account – things begin to work just fine!

    XDocument xdoc = XDocument.Load(new StringReader(soapResponse));
    
    XNamespace soap = "http://schemas.xmlsoap.org/soap/envelope/";
    XNamespace ns = "http://localhost/PCMilerWS/";
    
    var results = xdoc.Root.Element(soap + "Body").Descendants(ns + "StpLineType");
    

    But the main question really is: why on earth are you manually parsing a SOAP response?? …..

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

Sidebar

Related Questions

Let's say that I have a set of relations that looks like this: relations
Let's say I can call a method like this: core::get() . What is the
Let's say I have a text file composed like this ##### typeofthread1 ##### typeofthread2
Let's say I have table with column 'URL' whrere I store urls like this
Let's say I dynamically create a timer like this: System.Timers.Timer expirationTimer = new Timer(expiration
let's say I've got: target.o: target.h target.c gcc $(CFLAGS) -c target.c But I'd like
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say there is a graph and some set of functions like: create-node ::
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.