XML on the fly

Hi,

I've a problem. 
I have to read a xml file from url (ex.
http://www.remote_server.blelele/search?qt=request&nm=10&st=0&reg=14)
and convert it. I think(probably;)) that this xml is generate
on-the-fly. Of course, I can read this xml, if I write this address in
browser.
It works good if I've got this file on my test server, but if I use
file from remote server it doesn't work.

In order to ilustrate this problem, I paste same code:

It works fine:
XmlDocument XMLtest = new XmlDocument();
XMLtest.Load("http://www.my_server.blelele/search.xml");

wrong:
XmlDocument XMLtest = new XmlDocument();
XMLtest.Load("http://www.remote_server.blelele/search?qt=request&nm=10&st=0&reg=14");
0
greg_gm (1)
11/3/2004 8:34:18 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
613 Views

Similar Articles

[PageSpeed] 29

Greg wrote:

> I have to read a xml file from url (ex.
> http://www.remote_server.blelele/search?qt=request&nm=10&st=0&reg=14)
> and convert it. I think(probably;)) that this xml is generate
> on-the-fly. Of course, I can read this xml, if I write this address in
> browser.
> It works good if I've got this file on my test server, but if I use
> file from remote server it doesn't work.

What exactly doesn't work? Any exceptions?
If you have no access to that server, you know, there is no magic way to 
get XML from it.

-- 
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
0
Oleg
11/3/2004 10:50:40 AM
May be you can try , using HTTP objects to get the response from the URL and
retrieve the XML out of it
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:#I2YmMZwEHA.2600@TK2MSFTNGP09.phx.gbl...
> Greg wrote:
>
> > I have to read a xml file from url (ex.
> > http://www.remote_server.blelele/search?qt=request&nm=10&st=0&reg=14)
> > and convert it. I think(probably;)) that this xml is generate
> > on-the-fly. Of course, I can read this xml, if I write this address in
> > browser.
> > It works good if I've got this file on my test server, but if I use
> > file from remote server it doesn't work.
>
> What exactly doesn't work? Any exceptions?
> If you have no access to that server, you know, there is no magic way to
> get XML from it.
>
> -- 
> Oleg Tkachenko [XML MVP]
> http://blog.tkachenko.com


0
sandeepb (1)
11/8/2004 9:11:20 AM
Reply:

Similar Artilces:

best way to deserialize xml
I'm at a quandry as to what's the best/fastest way to deserialize an incoming xml stream? I ran a small test on xmlserializer and on a small file it performed 10 times worse then when I used the XMLDocument and deserialized the values myself. Is the xmlserializer really that slow? I'm expecting a file about 1 MB in length and if it's that slow on a 2 K file then I can't phantom how it's going to behave on a 1 MB file. Should I just skip the xmlserializer and XML Dom and go straight to xmlreader and do the deserialization myself? This has been discussed a few times...

Validating XML with XSD's
I have written a small app that uses the XmlValidationReader and a customer ValidationEventHandler function. When I validate the XML I get detail structured information like child is not defined or structure is invalid but now I am getting into facets. I am working with data lengths and I have found that I get the following message when a value is the incorrect length: "The 'elementname' element has an invalid value according to its data type. The real error is that the data value is longer than allowed. In XML Spy I receive the follwing error for this scenario: "Value Doe...

How can I use XML in Excel 2003 Student edition?
Hi AFAIK you can't as this feature is not available in this version -- Regards Frank Kabel Frankfurt, Germany "jim22" <jim22@discussions.microsoft.com> schrieb im Newsbeitrag news:400833B7-601B-48F0-85AC-49A165CBEF8F@microsoft.com... > ...

XML Root Info
OK, I am not any closer than I was yesterday. I have an XML doc that need to have this info. <FDXSubscriptionRequest xmlns:api="http://www.fedex.com/fsmapi" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="FDXSubscriptionRequest.xsd"> How do I get it in there. I have read all through the attirbute class and even posted a post on here where the person told me I was doing something wrong. How do I change the xmlns and add the xsi: info inthe stream. I have classes set up that I desearialize. Do I just have to copy the...

load hierarchically related data from xml
I am researching some options for loading hierarchically related data from xml into an sql server database. I do not have the primary keys in the source xml files. The primary keys are identity fields in the tables, and are auto generated integers. I have about 40 tables that are related, and the data is contained in a single xml file that will be hierarchical and related. I am using the following technology/tools: SQL Server 2000 sp3a SQLXML 3 ..Net c# ..Net framework on the servers, latest updates The product requirements include using C#, .Net framework on the servers, xml, an...

Imports System.Xml In VS 2010
OK, I tried the web forums, but since the real gurus hang out here... This has to be me, but I'm stumped :-( I'm setting up a simple XML read-write demo (VB Winforms) in Visual Studio 2010 Premium (tried in both the RC and RTM) and added: Imports System.Xml Result: Error Namespace or type doesn't contain any public members or cannot be found... VS 2008 equivalent example recognizes the Imports statement fine. Note: I tried this with the app targeting both .Net 3.5 and 4.0. Same result (two different PC's). Any advice much appreciated (and, I'll ac...

Stop and Resume parsing of large XML file
Currently I am using XmlReader (but I am open to other options) to parse an XML file, and I would like to be able to stop/break the current parse (simple enough) and then resume it later (say after a reboot). Is there any way to get the current location in the file that the XmlReader has reached so as to be able to restore that and start from that point later? TIA. Brian Cryer wrote: > Currently I am using XmlReader (but I am open to other options) to parse > an XML file, and I would like to be able to stop/break the current parse > (simple enough) and then resume it later (...

Converting XML > Dataset
Hi ! Here's my problem in english :-) I want to convert the mssecure.xml file from Microsoft into an dataset to store it in an SQL-Database. My code in VB looks like this : Dim ds As New DataSet Dim doc As New Xml.XmlDocument doc.Load("D:\mssecure.xml") Dim sReader As New StringReader(doc.InnerXml) ds.ReadXml(sReader) The problem is : At the ds.readxml(sreader) command i get an error which told me, that there is an problem whith a relationship in "ProductFamilies" I hope my english is good enough to explain... Please help ! Thanks !!! Christoph Duesmann C...

convert a custom config file to XML
Hi, I need to convert a home made config file to an XML one. My config file looks like this (it's an app that display some text in function of time): //config.cif BEGIN_241104 06:00-08:29;1;AAAA;BBBBB 09:00-12:29;1;CCCCC;DDDD END I don't know how to do it, maybe something like this but don't know if it's possible to do this: <Date = "241104"> <Hour>06:00-08:29</Hour> <Flag>1</Flag> <Label1>AAAA</Label1> <Label2>BBBBB</Label2> <Hour>09:00-12:29</Hour> <Lab...

XML Instance from XML Schema
How do I create an instance of XML from XML Schema (xsd to be specific) and instantiate its elements in C#? EAI wrote: > How do I create an instance of XML from XML Schema (xsd to be specific) and > instantiate its elements in C#? You can't. What you can do is getting Schema-information from the SchemaObjectModel and build some XML for this. But as there is not "the one" XML-file that matches the schema, there is no easy way (consider XHTML). -- Pascal Schmitt Can I create a cs file from schema using XSD tool and then create new instance and instantiate it a...

Import of XML on Virtual Machine
Hi, We are attempting to import an xml schema into a Virtual Machine (sbs server o/s) but in the past this has worked effectivly in order to test client customizations and create crystal reports in test environment. This instance we are recieving errors (up to 8-10) during the import of the schema onto the virtual machine. Any Ideas???? Any help greatly appreciated! Thanks, Nathan Hi Nathan Is this the same XML file as imported previously? Are the errors all similar? Could you post an error here please. Import errors aren't always anything to be concerned with, it may just be the...

Trying to read XML file into dataset
Hello. Developing a web site in VS2005, SP1, VB, .NET 2.0, ASP.NET 2.0 on XP Pro, SP2. I eventually want to use a gridview table to view xml data, but right now i can't seem to get my xml data into a dataset so that i can use it. I have an XML file and can open it in IE. There is no XSD or XSL file to go with it. I can't seem to get the XML data into a dataset. I tried using the following code, but it just does nothing. It doesn't give an error. It just executes the code and does nothing. Dim dataSet As DataSet = New DataSet dataSet.ReadXml("...

Question regarding Linq to XML query
This is my first foray into Linq for XML, so I'm probably doing something relatively easy to correct. First off, I have some XML similar to below: <packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/server_group" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:ns4="http://www.swsoft.com/webservices/vza/4.0.0/vzatypes" xmlns:ns3="http://www.swsoft.com/webservices/vzl/4.0.0/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" time="2009-04-28T19:04:02+0000" priority="0" ...

Mapping dataset tables to XML output
Hi, I'm really stuck with this one. I have a dataset with two tables. One table is company data, and the other is contacts. I populate these by using a SP in SQL Server which returns the two tables in one call. I'm using Microsoft EnterpriseLibrary for Data to get the data from SP. It works fine and I get two tables in the dataset, "Table1" and "Table2". I then have an XML-file, which will serve as a template to generate the XML-schema, which I load into the dataset with the InferXmlSchema method. This gives me a perfectly good looking XML-Schema of how I w...

XML errors in webservice call
I am creating some code that runs in Excel using VSTO. I am trying to get some xml from a webservice, using the following code: GBWPipeline.PipelineService pipeline = new GBWPipeline.PipelineService(); string xml = pipeline.GetOfferSale(OfferSheetId, CustomerId).GetXml(); I get a "There is an error in XML document. (1, 220)" message. If I execute the same method from WebServiceStudio, it works fine (using the same values for the parameters) and returns the xml that I expect (and doesn't complain about any errors). It also works in a normal WinForms application. It is only insid...

Scanning website files on the fly
Hi folks, One of my websites got infected with a virus and was blocked by Google. I stumbled across this page and it really helped me getting the problem solved very quickly without having to reupload my website from my computer. I can't paste the whole method here because it's explained in pictures. Check out: http://www.orioncities.com/scanning-website-files-for-malware-and-viruses I hope this will help someone. Their are many well known and known to be good sites, that will help others with malware and virus infection, I wouldn't click on any link inclu...

Newbie in XML with C# question
Hello, I am learning how to using XML documents to store data. I get this error: Access to the path "c:\inetpub\wwwroot\Info.xml" is denied. I have tried with the full path of the file, with / infront of the file. How do I get the data in too the xml document Here is the code below: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Xml; using System.Xml.XPath; ...

VB.NET: Writing attribute and Elements to Xml
Say i have this Xml file <Books> <Book type="1"> <Author>Peter</Author> <Section>1</Section> </Book> </Books> how to create another automatic set of IDs and datas for the Xml tag so that when i type in another set of data... The content of the Xml file will become: <Books> <Book type="1"> <Author>Peter</Author> <Section>1</Section> </Book> <Book type="2"> <Author>John</Author> <Section>2</Section> <...

XML Guru Needed!
In converting a VB6 app using MSXML2 to a VB.NET app using System.xml, I'm looking a cross-reference. What would the equivalent .NET XML command be to 'transformNodeToObject?' Thanks! Steve Covert wrote: > In converting a VB6 app using MSXML2 to a VB.NET app using System.xml, I'm > looking a cross-reference. What would the equivalent .NET XML command be to > 'transformNodeToObject?' If you want to do an XSLT transformation in .NET 1.0 or 1.1 look at System.Xml.Xsl.Transform: <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpre...

Getting XML back to the server.
I generate some XML and then load it into the XML web control so that I can using the XML in my client side javascript. Assuming I add a new node to the XML data, is there a way to easily get it back to the server. I can always set the value of a textbox to the XML data and then reload the XML Webcontrol on postback, but I thought there might be a better way. Thanks in advance. Jim Well, consider a hidden form control rather than a textbox as a textbox has size limits that a hidden form field does not. You might also take a look at using XML Data Island the DataSourceObject [DSO] (IE O...

Problems validating an xml file without specifying the default namespace.
Hi All, I'm trying to validate an xml document. I'm having trouble setting the default namespace of the xml document. If I hard encode the namespace in the xml file then everything works fine. But I can't do this because it breaks our old tools which validate the xml to a dtd (error saying the dtd doens't allow xmlns attribute on the root element). So I'm trying to add the default namespace to the xml file by code. As follows: string DefaultNameSpace = "http://www.mydefaultnamespace.com"; NameTable nt = new NameTable(); XmlNamespaceManager nsmgr = new XmlName...

Open and Save XML
I am using Excel 2000 and want to open and save files in XML. 1. Is there anyway to do this? 2. Do you know of any converters to install so that it can be done? Thanks ...

System.Xml.Schema.XmlSchemaElement.UnhandledAttributes Property
Somebody please tell me what is the matter with the System.Xml.Schema.XmlSchemaElement.UnhandledAttributes property. I don't seem to be able to access no matter how I try... Rein Do you have any namespaced attributes on the element? -- This posting is provided "AS IS" with no warranties, and confers no rights. "Rein Petersen" <rmpetersen@bogus.hotmail.com> wrote in message news:OYtB$9eXDHA.1644@TK2MSFTNGP10.phx.gbl... > Somebody please tell me what is the matter with the > System.Xml.Schema.XmlSchemaElement.UnhandledAttributes property. > > I do...

Complex XML transformation in a better performance way?
The problem is how to achieve the transformation as below: The source xml contains tons of repeating structure like below, each item node contains a person element and a insurance element that correlate to the Person element with the person id. <Item> <Person id=”p123” name=”someone1”> <Insurance ref=”p123” detail=”blabla1”> </item> <Item> <Person id=”p123” name=”someone1”> <Insurance ref=”p456” detail=”blabla2”> </item> <Item> <Person id=”p456” name=”someone1”> <Insurance ref=”p123” detail=”blabla3”> </item> Th...

xml schema: elements with unique attribute values.
Hi all. I�m a bit newbie writing xml schemas. Is it possible to define xml element that must have unique attribute values in same level. For example if i have a xml - document: <list> <subsection name="first"> <!-- subsection contents --> </subsection> <subsection name="first"> <!-- ERRROR!!! --> <!-- subsection contents --> </subsection> <subsection name="second"> <!-- subsection contents --> </subsection> </list> Schema: <xs:complexType n...