Siebel Portal Framework Guide > Delivering Content to External Web Applications > Connecting to the XML Web Interface >

Query String


You can send HTTP requests to SWE using a query string. For example, the following code sample illustrates an Active Server Page that uses MSXML to make an HTTP request. The request logs in to the Siebel application and navigates to the Account List View. The XML response from SWE is transformed into HTML using XSLT.

NOTE:  For code snippets that demonstrate transforming an XML response from SWE into HTML, see Sample XSLT.

<% @LANGUAGE="VBScript" %>

<%

'----------------------------------------------

'Open HTTP connection and send XML command req

'----------------------------------------------

   strURL = "http://" & Request.form ("swe") & "/start.swe?SWECmd=ExecuteLogin&SWEDataOnly=1&SWEUserName=sadmin&SWEPassword=sadmin&SWESetMarkup=XML
ZOSet xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", strURL, False
xmlhttp.send ()
Set ologinXmlDoc = xmlhttp.responseXML

strCookie = xmlhttp.getResponseHeader ("Set-Cookie")
On Error Resume Next
If strCookie = "" Then
      Response.Write ("Unable to connect to Siebel Web Server. Please check Login Name, Password, and Siebel Web Server URL")
Response.End

End If
strSessionId = mid(strCookie,inStr(strCookie,"!"),inStr(strCookie,";")-inStr(strCookie,"!"))

strURL = "http://" & Request.form ("swe") & "/start.swe?SWECmd=GotoView&SWEView=Account+List+View&SWESetMarkup=XML&SWEDataOnly=1" & "&_sn=" & strSessionId
Set xmlhttp = Nothing
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", strURL, False
xmlhttp.send ()
Set oXmlDoc = xmlhttp.responseXML

'-----------

'Session Var

'-----------

Session ("SWESessionId") = strSessionId
Session ("swe") = Request.form ("swe")

'-----------

'Prepare XSL

'-----------

sXsl = "acctresponse.xsl"
Set oXslDoc = Server.CreateObject("Msxml2.DOMDocument")
oXslDoc.async = false
oXslDoc.load(Server.MapPath(sXsl))

%>

<HTML>

<HEAD>

<TITLE>My Portal</TITLE>...

<BODY>

...

<TD colSpan=2><%Response.Write (oXmlDoc.transformNode(oXslDoc))%> </TD>

...

</BODY>

</HTML>

Siebel Portal Framework Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.