Click to See Complete Forum and Search --> : Posting XML files


tomw0184
09-20-2003, 11:06 AM
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!:confused:

Khalid Ali
09-20-2003, 11:20 AM
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)

tomw0184
09-20-2003, 11:39 AM
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?

Khalid Ali
09-20-2003, 12:17 PM
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

tomw0184
09-20-2003, 02:08 PM
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!!

paps
09-21-2003, 07:32 PM
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.......

tomw0184
09-21-2003, 09:42 PM
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.

Khalid Ali
09-22-2003, 05:22 AM
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.

lillu
09-22-2003, 11:42 AM
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);
}

tomw0184
09-24-2003, 08:13 AM
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.

Khalid Ali
09-24-2003, 08:31 AM
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...