Friday, 15 April 2011

xml - Help to convert this PHP code to VB.NET code -


I have a code for sending XML through POST. But this code is in PHP and I need it in VB.NET is.

Any help to change this code?

  $ XMLFile = (I have created an xml file here XML has been encoded INO-885 9) $ ch = curl_init (); Curl_setopt ($ CH, CURLOPT_URL, "URL where I send XML"); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, "XMLDATA =". $ XMLFile); $ Result = curl_xac ($ CH); Curl_close ($ ch); $ Result = stripslashes ($ result); $ Xml returning = new simple assemment ($ result); If ($ xmlreturned-> NotificationResultHeader-> RRC == 0) {if ($ xmlreturned-> NotificationResultList-> NotificationResult-> NRC == 0) {Echo "Fine successor.";  

And how do I convert this PHP code too:

  $ msg = htmlentities ($ msg); $ Msg = urlencode ($ msg);  

You need to use more sections. The code will look something like this ( My VB is a bit wry these days ):

  In the form of a dim xmlDoc XmlDocumnet "You can prepare the XML document here. .. 'slow ASCIIEncoding = new ASCIIEncoding (encoding as in the form of) dim POSTDATA string POSTDATA = "XMLDATA =" + xmlDoc.ToString () as dim data () byte data = encoding.GetBytes (POSTDATA) as' Prepare web request as ... dim myRequest HttpWebRequest myRequest = CType ("here to post url"), http webbirst) myRequest.Method = "POST" myRequest.Co NtentType = "Application / X-www-Form-URLXode" myRequest.ContentLength = data.Length dim newstream stream = myRequest.GetRequestStream () Send data as' new stream. Write feedback (data, 0, data. Long) 'Get feedback as my response http web response myResponse = myRequest.GetResponse ()  

No comments:

Post a Comment