我使用XML加载。但我有DTD XML Load的问题。
我的XML加载代码是(在C#中) -
XmlDocument soapEnvelopeXml = new XmlDocument();
soapEnvelopeXml.LoadXml(@"<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<soap:Body>
<ProcessTGJob xmlns='http://dpi.careerbuilder.com/WebServices/RealTimeJobPost'>
<Batch>
<Header>
<Field name='CBVendorID' value='ED3H3MG5WM50GQP729GL' />
</Header>
<Job>
<Field name='CBDescription' value='Test Description' />
</Job>
</Batch>
</ProcessTGJob></soap:Body>
</soap:Envelope>");
Response.ClearHeaders();
Response.ContentType = "text/xml;charset=UTF-8";
string xmlString = soapEnvelopeXml.InnerXml;
Response.Write(xmlString);
Response.End();
执行代码时,它始终会给出错误is an unexpected token.
我无法理解代码中的问题。请帮帮我。
感谢您的帮助。
答案 0 :(得分:0)
将内容类型更改为text / xml或application / xml;