www.webdeveloper.com
Results 1 to 11 of 11

Thread: Posting XML files

  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Question Posting XML files

    I have a web site and want to use a fulfillment service to send items to my customers.

    They want me to use XML so I have learned how to create an XML file.

    My question is . . . how do I send it to their URL address??

    HELP!
    Tom

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,120
    please explain more.

    do you want to have XML files ready to be served using HTTP( which is typing an adress in the browsers address bar)
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  3. #3
    Join Date
    Sep 2003
    Posts
    5

    Further Explaination

    I'm not sure. I think - Yes

    I have the XML file ready to go.
    What do I do next?
    Assume that I have been given the HTML address for their server. Is this a ".dtd" or an "html" URL?

    How do I actually cause the file to be sent?

    Does this help?
    Last edited by tomw0184; 09-20-2003 at 11:43 AM.
    Tom

  4. #4
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,120
    you can put it in a folder on your webserver, suppose you create a directory in your webserver called

    xmlstuff/

    and you have a sample file names
    sample.xml

    to access this file one may need this url

    http://yourdomain.com/xmlstuff/sample.xml

    you can type the above in the location/address bar or you can put he above in a link and user by clicking can request this XML file
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  5. #5
    Join Date
    Sep 2003
    Posts
    5

    Making Progress

    Khalid,

    We are making good progress. I understand what you are saying.

    This URL (http://yourdomain.com/xmlstuff/sample.xml) does not appear within my XML file (sample.xml) anywhere. Correct?

    Does their .dtd address have to appear anywhere within my XML file?

    I see how they can now request my file, BUT how do I SEND THEM my XML file (sample.xml)? They want me to send it to them.

    I'm staying with you. . . just move slowly! Thanks!!
    Tom

  6. #6
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    37

    easyyyyy

    Hey sending an XML files pretty easy, just use Javascript or VBscript, using HttpRequest Object, this object can make an HTTP request for u from a URL, with the XML going as an POST if needed. Heres some Javascript code sample to do exactly that:

    XslHttp = new ActiveXObject("Msxml2.XMLHTTP");
    XslHttp.open("POST","SomeURL", false,"","");
    XslHttp.setRequestHeader("content-type","text/xml");
    XslHttp.send(XMLDOC Object);

    This code will access "SomeURL" and send XMLDOC to that URL, as a POST.....


    Hope this helps.......

  7. #7
    Join Date
    Sep 2003
    Posts
    5

    Sending an XML files??

    Thanks pap for your reply,

    Sending an XML files may be easy, but I must be missing something!!! Let's review the points. Please respond to each question.

    Regarding this script . .

    XslHttp = new ActiveXObject("Msxml2.XMLHTTP");
    XslHttp.open("POST","SomeURL", false,"","");
    XslHttp.setRequestHeader("content-type","text/xml");
    XslHttp.send(XMLDOC Object);

    1. What is this? Is it a complete file, message, html, or what?Where does this script go? How does it work?

    2. Is "Some URL" my recipicant's ".dtd" or just a regular ".html"?

    3. Do I write the 4th line as exactly like this?

    XslHttp.send(sample.xml Object);

    I am sorry, but you have me very confused. I must be missing something very basic here.
    Tom

  8. #8
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,120
    Here some clarifications(I'll try)
    The code posted above will only work for IE5+ browsers.

    Here are answers


    1. What is this? Is it a complete file, message, html, or what?Where does this script go? How does it work?


    The script is a good piece of script that opens a stream to the given destination,where destination will be "SomeURL"
    in the line below

    XslHttp.open("POST","SomeURL", false,"","");

    2. Is "Some URL" my recipicant's ".dtd" or just a regular ".html"?

    This "someurl" will be the address where you want to send the XML file.

    In my pinion you are not understanding it correctly.I am sure when some one said about sending a file that means it should be residing at your server and with a given URL people can access it.

    What does a .dtd have anything to do with this??. adtd is a totally separate thening.That actually controls how the XML file will look like(eor e.g. what will be the names elements and what data type will they contain).

    3. Do I write the 4th line as exactly like this?

    the fourth line assumes that you already know how to create and XML dataisland object, you create that and then you pass that do the send method.


    Make sure you understand the concept that what exactly is you require to do.
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  9. #9
    Join Date
    Aug 2003
    Location
    London, United Kingdom
    Posts
    117
    Hi,

    You can write a function in javascript and embed it in an asp page.

    This script will send (using the post method) any file you specify to a server. Use full URL path, eg. "http://..."

    function postFile()
    {
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    xmlhttp.open("POST", "http://yoursite.com/sample.xml", false);
    xmlhttp.send();

    alert(xmlhttp.ResponseText);
    }
    You end up being who you are.
    http://www.geocities.com/lillamarta

  10. #10
    Join Date
    Sep 2003
    Posts
    5

    Unhappy Thanks

    My thanks to all who attempted to help me with this problem, but now I an totally confused.

    At first I thought I was understanding, but now have no idea what needs to be done. The discussion has just gotton too technical for me.
    Tom

  11. #11
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,120
    Ohhkkkay..

    Lets do this.

    First either ask your clients or try to understand it ursefl that what exactly is required to do???
    this is very important...
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles