Transports and Interfaces: Siebel eBusiness Application Integration Volume III > EAI HTTP Transport >

Examples Using HTTP Request


This section provides you with a couple of examples of using the EAI HTTP Transport in two modes—Session and Sessionless. This is to help in understanding how to use the EAI HTTP Transport in your business.

Controlling Login Sessions with Session Mode

The session mode allows control over login sessions. In this mode you log in first and open a session. Any message can be exchanged without having to log in again until you explicitly log off.

The following example shows parameters for Login, Request, and Logoff in a session mode HTTP request. Session cookies are required in a case such as this.

NOTE:  You enter each of the following URLs as a continuous line of code.

  • The following URL logs in to a server with passed parameters for username and password:

    HTTPLoginURLTemplate = "http://$ServerPath$/start.swe?SWEExtSource=$Source$&SWEExtCmd=ExecuteLogin&User
    Name=$Username$&Password=$Password$"

  • The following URL passes a query string as the SWEExtData value along with the GET request:

    HTTPRequestURLTemplate = "http://$ServerPath$/start.swe?SWEExtData=<Prop>somedata</Prop>
    HTTPRequestMethod='GET'"

  • The following URL logs off from the server:

    HTTPLogoffURLTemplate = "http://$ServerPath$/start.swe?SWEExtCmd=Logoff"

    ServerPath = "siebel1/eai"

    Username = "pdavis"

    Password = "1234abcd"

    Source = "testdoc"

In the preceding example, the ServerPath variable value of siebel1/eai is substituted for the token $ServerPath$. The Source variable value of testdoc is substituted for the $Source$ token, the Username variable value of pdavis for the token $Username$, and the Password variable value of 1234abcd for the $Password$ token.

Any XML document represented by the entry for SWEExtData can be put into the body. This would change the sample code so that the HTTPRequestURLTemplate would read as:

HTTPRequestURLTemplate = "http://$ServerPath$/start.swe?

Sending Requests in Sessionless Mode

The following example includes a Request Method, a Request, and a Login for a sessionless mode request. In this example, the request is simply passed to the secure server using the POST command. Unlike the Session Mode example, this request sends data in the body of the request. This request does not require cookies.

HTTPRequestMethod = "POST"

HTTPRequestURLTemplate = "https://accounts.mypartner.com/server/login.asp"

HTTPRequestBodyTemplate = "Acct=ABCIntl&User=$Username$&pwd=$Password$"

Username = "acctuser"

Password = "123456789abcdefg"

Accessing a URL Protected by Basic Authentication

You can use basic authentication with the EAI HTTP Transport to send messages. The format to use in the URL to be able to access a URL protected by basic authentication with HTTP Outbound is:

http://username:password@host/rest of the URL

For example, "http://Administrator:manage@169.254.85.21:5555/."

NOTE:  For outbound HTTP requests only server-side authentication is supported.

Transports and Interfaces: Siebel eBusiness Application Integration Volume III