Bookshelf Home | Contents | Index | PDF |
Siebel Portal Framework Guide > Delivering Content to External Web Applications > Connecting to the XML Web Interface > Submitting HTTP Requests Through the Web ServerYou can send HTTP requests to SWE through the Siebel Web Server using a query string or XML command block. Examples of these two methods are provided in the following sections. Query StringYou 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 Accounts screen. The XML response from SWE is transformed into HTML using XSLT. '---------------------------------------------- '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 strCookie = xmlhttp.getResponseHeader ("Set-Cookie") End If strURL = "http://" & Request.form ("swe") & "/start.swe?SWECmd=GotoPageTab&SWEScreen=Accounts+Screen&SWESetMarkup=XML&SWEDataOnly=1" & "&_sn=" & strSessionId Session ("SWESessionId") = strSessionId sXsl = "acctresponse.xsl" <TD colSpan=2><%Response.Write (oXmlDoc.transformNode(oXslDoc))%> </TD> XML Command BlockYou can use an XML command block to send the HTTP request through the Siebel Web server. For example, you can submit inbound XML documents to SWE as the HTTP request body data. In the Java code sample below, the XML command block opens a socket connection to the Web server and writes the request data stream to the socket's OutputStream. public static final String FULL_XML_PROC_STR = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; InputStream in; if (request != null && request.length() > 0) socket = new Socket(url.getHost(), url.getPort()); toServer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream())); payload = FULL_XML_PROC_STR + request; toServer.println("Cookie: " + sessionID); // read the response fromServer.close(); |
Siebel Portal Framework Guide |