XML Over The Web Today Dino Esposito Wrox Press 6-313
Agenda Present and future of XML and HTTP Present and future of XML and HTTP XmlHttpRequest XmlHttpRequest Using XmlHttpRequest in Visual C++ ® apps Using XmlHttpRequest in Visual C++ ® apps Architecturally speaking… Architecturally speaking…
Why XML Text-based and human-authorable Text-based and human-authorable Available on (almost) all platforms Available on (almost) all platforms Great for describing data Great for describing data Designed to be simple and effective Designed to be simple and effective
Why HTTP Broadly accepted Broadly accepted Jumps through firewalls Jumps through firewalls Designed to be simple but effective Designed to be simple but effective No runtime support unlike DCOM
Why XML And HTTP Another (better?) component model Another (better?) component model Increase interoperability Increase interoperability No mandated API or runtime No mandated API or runtime Industry standards Industry standards
The World Without XML HTML and ASP HTML and ASP Server-side pages Remote data services Remote data services COM calls through HTTP Remote scripting Remote scripting ECMAScript calls through HTTP
The World Without HTTP DCOM DCOM Complexity and dynamic ports COM Internet services COM Internet services DCOM over HTTP via tunneling TCP Internet InterORB protocol Internet InterORB protocol Protocol to connect different ORBs
The World With XML+HTTP Connect to remote services Connect to remote services Platform and language neutrality Send and receive XML text Send and receive XML text Get the best of both worlds Get the best of both worlds Encoding and data representation Connect to a Linux CGI from Visual Basic ® !
SOAP Breaks In Services over the network Services over the network Connect through HTTP Communicate through XML An XML-based language for remote method invocation An XML-based language for remote method invocation Open specification with trial implementations Open specification with trial implementations Doesn’t reinvent any wheel Doesn’t reinvent any wheel
Agenda Present and future of XML and HTTP Present and future of XML and HTTP XmlHttpRequest XmlHttpRequest Using XmlHttpRequest in Visual C++ apps Using XmlHttpRequest in Visual C++ apps Architecturally speaking… Architecturally speaking…
XmlHttpRequest? Part of MSXML ( Microsoft.XMLHTTP ) Part of MSXML ( Microsoft.XMLHTTP ) Arbitrary HTTP requests and responses Arbitrary HTTP requests and responses Does not use SOAP (yet?) Does not use SOAP (yet?)
XmlHttpRequest And SOAP Client Web Service SOAP Request SOAP Response Web Service COM-based client XmlHttpRequest URL XMLDOM
How It Works Create an instance of the object Create an instance of the object Set operation and URL Set operation and URL Send data Send data Get the response Get the response Raw text, XMLDOM, IStream, array
A XMLHTTP Request Set xmlhttp = CreateObject("Microsoft.XMLHTTP") xmlhttp.open "GET", “ false false xmltext = " MSDN " Set xmldom = CreateObject("Microsoft.XMLDOM") xmldom.loadXML xmltext xmlhttp.send xmldom
A XMLHTTP Response <% set xmldom = Server.CreateObject("Microsoft.XMLDOM") xmldom.load(Request) set n = xmldom.selectSingleNode("magazine") n.text = “MSDN Magazine" strText = “New text is: " & xmldom.xml Response.Write strText %>
Methods And Properties
Agenda Present and future of XML and HTTP Present and future of XML and HTTP XmlHttpRequest XmlHttpRequest Using XmlHttpRequest in Visual C++ apps Using XmlHttpRequest in Visual C++ apps Architecturally speaking… Architecturally speaking…
Example #1 C++ application that utilizes the component C++ application that utilizes the component XmlHttpRequest
Example #2 MFC application that fills its own UI with XML data taken from an ASP page MFC application that fills its own UI with XML data taken from an ASP page XmlHttpRequest
Exchanging XMLDOM Use send to pass an XMLDOM Use send to pass an XMLDOM Target ASP pages process it Target ASP pages process it xml.loadXML(Request) ASP page returns XML text ASP page returns XML text Set ContentType to text/xml Use responseXML to retrieve it
Agenda Present and future of XML and HTTP Present and future of XML and HTTP XmlHttpRequest XmlHttpRequest Using XmlHttpRequest in Visual C++ apps Using XmlHttpRequest in Visual C++ apps Architecturally speaking… Architecturally speaking…
Web Services Any service available on the Web Any service available on the Web Components, applications, servers, pages Platform and language neutrality Platform and language neutrality Web services versus DCOM Web services versus DCOM
New Web Apps Web client Web Server Operating System Components Any platform! DataStore Win32 client Other platform client