Hi there,
This is my first steps with XML and I must send a XML by HttpRequest (Which is not a problem to me now). By I've a question about DTDs. According to the HttpRequest destination APIs, I must validate my XML using an External DTD whos located there (this is for Canada Post shipping : http://cybervente.postescanada.ca/DevelopersResources/protocolV3/eParcel.dtd). I know how to write / read XML, but not according to DTD... Is there a difference?
Can someone tell me how and the easiest way to do that? I've look a good part of good post from Google and there's never what I'm looking for ...
Thank you!
ADD #1
Note : I know what a DTD for, and I can create one on my own with a plain text editor and basing the XML on the DTD, but I realy mean, is there a way to take advantage of DTD in C# (Creating an object or someting...)
ADD #2 Add-on : Any of you guys already set up an application to talk to Canada Post API using webresque? Because I'm stunk! I send my request with my data and it never finish so never return response ... here is my code :
public oShippingResponse RetreiveShippingCost(oShippingInformations shipInfos) {
// Send request
WebRequest request = WebRequest.Create("http://sellonline.canadapost.ca");
XmlDocument xmlDoc = shipInfos.WriteAsXML();
request.ContentType = "text/xml";
request.Method = "POST";
xmlDoc.Save(request.GetRequestStream());
try {
WebResponse response = request.GetResponse();
} catch (Exception ex) {
throw ex;
}
return new oShippingResponse();
}