Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

xml post(C#)

xmlpost by HttpWebRequest:
protected string PostXmlToURL(string url,string data)
{
    HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(url);
    hwr.Method = "POST";
    Stream stream = hwr.GetRequestStream();
    StreamWriter sw = new StreamWriter(stream, System.Text.Encoding.UTF8);
    sw.Write(data);
    sw.Close();
    stream = hwr.GetResponse().GetResponseStream();
    StreamReader sr = new StreamReader(stream);
    string result = sr.ReadToEnd();
    sr.Close();
    return result;           
}
xmlpost by XMLHTTP:
·¢ËÍÇëÇó.
   StreamReader sr=new StreamReader(Server.MapPath(XMLPathFull));
   MSXML2.XMLHTTPClass xmlHttp = new MSXML2.XMLHTTPClass();   
   xmlHttp.open("post",strURL,false,"","");  
   xmlHttp.setRequestHeader  ("Content-type","text/xml;charset=UTF-8");
   xmlHttp.send(sr.ReadToEnd());
   //µÃµ½response
   string backxmlstring=xmlHttp.responseText.ToString();
½â¶ÁÏìÓ¦.
   byte[]   buf   =   Request.BinaryRead(Request.ContentLength);   
   string   str   =   System.Text.Encoding.UTF8.GetString(buf);  
xmlpost by js:
<script language="javascript" type="text/javascript">
    function PostXml(url, data) {
        var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        xmlhttp.Open("POST", url, false);
        xmlhttp.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xmlhttp.SetRequestHeader("Content-Length", d


Ïà¹ØÎĵµ£º

C#ÖвÙ×÷XML Node½Úµãϸ½Ú²Ù×÷

ÎÄÕÂÀ´Ô´£ºIT¹¤³Ì¼¼ÊõÍø http://www.systhinker.com/html/43/n-11643.html
ÓõÄÊÇÒ»Öֺܱ¿µÄ·½·¨£¬µ«¿ÉÒÔ°ïÖú³õѧÕßÁ˽â·ÃÎÊXML½ÚµãµÄ¹ý³Ì¡£
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏÂ:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="fantasy" ISBN="2-3631-4">
  ......

¹ØÓÚHTTP·ÃÎÊXMLÎļþµÄËæ±Ê

×î½üÏîÄ¿ÖÐÒªÓõ½Ò»Ð©web xmlÊý¾ÝµÄ·ÃÎÊ·ÖÎö£¬²ÉÓÃmsxml
1.msxmlÊÇ΢ÈíÌṩµÄ£¬ÔÚ·Ç¿ª·¢»·¾³ÖУ¬ÐèҪע²á
2.xmlÎļþ£¬Ò»°ãÔÚµÚÒ»¾äÓбàÂ뷽ʽ£¬Ò»°ãĬÈÏÊÇutf-8£¬ÊôÓÚÒ»ÖÖunicode
3.´ÓÍøÂç²É¼¯µÄxmlÊý¾Ý£¬ÐèҪʹÓÃwinnetº¯Êý¿â
4.winnet²É¼¯×ÔÍøÂçµÄÊý¾Ý£¬Ä¬ÈϵĶ¼ÊÇCP_ACP¸ñʽµÄ£¬¼òµ¥Ëµ¾ÍÊÇANSI»òUNICODE£¬UTF8µÄ±àÂë ......

ÓÃJAXB´æÈ¡XMLÊý¾Ý

JAXB¸ÅÒª
JAXBΪJava Architecture for XML BindingµÄËõд£¬ÒâΪXML°ó¶¨µÄJAVA¿ò¼Ü¡£ËüÌṩÁËÒ»Ì׿ÉÒÔ¼òµ¥´æÈ¡XMLÊý¾ÝµÄAPI£¬Í¬Ê±£¬JAXB¿ÉÒÔ¸ù¾ÝXMLµÄschema×Ô¶¯Éú³É²Ù×÷XMLµÄJAVAÀà¡£ÀûÓÃJAXB£¬Ê¹ÓÃJAXB×Ô¶¯Éú³ÉµÄ²Ù×÷XMLµÄJAVAÀ࣬¿ÉÒÔ»ù±¾Éϲ»Óÿ¼ÂÇXML½á¹¹¶ø¼òµ¥µØ´æÈ¡XMLÊý¾Ý¡£
JAXBµÄÏÂÔØÓë°²×°
JAXBÖÁÉÙÐèÒªµ¼ÈëÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ