Saturday, January 16, 2010

Vbscript to post xml to Webservice…



Web service Define:

The term often refers to an interface for service oriented architecture (SOA),in which Web-based applications dynamically interact with other Webapplications using open standards that include XML running over HTTP, UDDI andSOAP. Such applications typically run behind the scenes, one program"talking to" another (server to server). Microsoft's .NET and Sun'sJava System (J2EE) are the major development platforms that natively supportthese standards.



VB Script to post xml to web service
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(sFileName, 1, True)
l1 = CreateObject("M
RequestXML=f.ReadAll 'Load the XML DOM Set x microsoft.XMLDOM") xml1.async = False call xml1.Load (sFileName)
l2.XMLHTTP") call XslHttp.open("
'Post the XML to the web service set XslHttp = CreateObject("Msx mPOST",ServerURL, false,"","") call XslHttp.setRequestHeader("content-type","text/xml")
fso = CreateObject("Scripti
call XslHttp.send(xml1.xml) ACK_Res = XslHttp.ResponseText 'Return the response XML Set ng.FileSystemObject") Set f = fso.OpenTextFile(sAckPath + trim (" \Res") & ".xml", ForWriting, True)
f.Write ACK_Res f.close set f= Nothing set fso=Nothing
set xml1 = Nothing