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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:18:53+00:00 2026-05-17T21:18:53+00:00

I am querying a soap based service and wish to analyze the XML returned

  • 0

I am querying a soap based service and wish to analyze the XML returned however when I try to load the XML into an XDoc in order to query the data. am getting an ‘illegal characters in path’ error message? This (below) is the XML returned from the service. I simply want to get the list of competitions and put them into a List I have setup. The XML does load into an XML Document though so must be correctly formatted?.

Any advice on the best way to do this and get round the error would be greatly appreciated.

<?xml version="1.0" ?> 
- <gsmrs version="2.0" sport="soccer" lang="en" last_generated="2010-08-27 20:40:05">
- <method method_id="3" name="get_competitions">
  <parameter name="area_id" value="1" /> 
  <parameter name="authorized" value="yes" /> 
  <parameter name="lang" value="en" /> 
  </method>
  <competition competition_id="11" name="2. Bundesliga" soccertype="default" teamtype="default" display_order="20" type="club" area_id="80" last_updated="2010-08-27 19:53:14" area_name="Germany" countrycode="DEU" /> 
  </gsmrs>

Here is my code, I need to be able to query the data in an XDoc:

string theXml = myGSM.get_competitions("", "", 1, "en", "yes");
XmlDocument myDoc = new XmlDocument();
MyDoc.LoadXml(theXml);
XDocument xDoc = XDocument.Load(myDoc.InnerXml);
  • 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-17T21:18:54+00:00Added an answer on May 17, 2026 at 9:18 pm

    You don’t show your source code, however I guess what you are doing is this:

    string xml = ... retrieve ...;
    XmlDocument doc = new XmlDocument();
    doc.Load(xml); // error thrown here
    

    The Load method expects a file name not an XML itself. To load an actual XML, just use the LoadXml method:

    ... same code ...
    doc.LoadXml(xml);
    

    Similarly, using XDocument the Load(string) method expects a filename, not an actual XML. However, there’s no LoadXml method, so the correct way of loading the XML from a string is like this:

    string xml = ... retrieve ...;
    XDocument doc;
    using (StringReader s = new StringReader(xml))
    {
        doc = XDocument.Load(s);
    }
    

    As a matter of fact when developing anything, it’s a very good idea to pay attention to the semantics (meaning) of parameters not just their types. When the type of a parameter is a string it doesn’t mean one can feed in just anything that is a string.

    Also in respect to your updated question, it makes no sense to use XmlDocument and XDocument at the same time. Choose one or the another.

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

Sidebar

Related Questions

Is there any framework for querying XML SQL Syntax, I seriously tire of iterating
I'm querying Sharepoint server-side and getting back results as Xml. I want to slim
When querying the database with the same query but different parameters, is it better
on querying a camle jpa component like <from uri=jpa:jpa.camel?consumer.query=select x from jpa.camel x/> <to
I'm querying rows from my sqlite database using Fetch and loading the results into
I am querying a sharepoint list via the web service api. Calling the service
When querying with LDAP against our Active Directory structure to look up user accounts,
I'm querying a bunch of information from cisco switches using SNMP. For instance, I'm
Well I am querying my DB, a table called bookBilling, to get a value
The db I am querying from is returning some null values. How do 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.