Adding an HTTP Sender

An HTTP sender is one that sends messages to an HTTP server using the HTTP protocol. HTTP senders should reference an XAI Class of HTTPSNDR.

Various parameters are required to establish a session with the target HTTP server. You specify these parameters by defining a collection of context values for the sender. A set of context types related to HTTP variables is provided with the product. The following section describes the context types and where appropriate, indicates valid values.

Before defining the HTTP sender, you need to find out how the HTTP server on the other side expects to receive the request, and in particular, to answer the following questions:

Context Type Description Values
HTTP URL1 - URL9

Used to construct the URL of the target HTTP server.

Since the URL may be long and complex, you can break it into smaller parts, each defined by a separate context record. The MPL server builds the full URL by concatenating the values in URL1 through URL9.

You may use substitution variables when entering values for URL parts.

HTTP Method The HTTP method used to send the message. POST or GET
HTTP Proxy Host If connecting to the remote system requires using an HTTP Proxy, then this context field can be used to configure the HTTP Proxy Host. If the Proxy Host is set, the Sender class must use the value specified to connect to the remote system via a proxy.
HTTP Proxy Port If connecting to the remote system requires using an HTTP Proxy, then this context field can be used to configure the HTTP Proxy Port. If the Proxy Port is set, the Sender class must use the value specified to connect to the remote system via a proxy. If the HTTP Proxy Host is not set, HTTP Proxy Port is ignored and the connection will be made directly to the remote system.
HTTP Transport Method Specifies the type of the message. You can either send the message or send and wait for a response. Send or sendReceive
HTTP Form Data

Used when the message is in the format of an HTML Form ( Content-Type: application/x-www-form-urlencoded).

This context specifies the form parameters (data) that should be passed in the HTTP message. Since a form may have multiple parameters, you should add a context record for each form parameter.

The value of a form parameter takes the format of x=y where x is the form parameter name and y is its value.

If y contains the string @XMLMSG@ (case sensitive) then this string is replaced by the content of the service response XML message.

If a context record of this type is defined for a sender, the sender uses the HTML Form message format to send the message even if @XMLMSG@ is not specified in one of the context records.

If a context record of this type is not defined for a sender, then the XML is sent with Content-Type: text/plain. When using POST it is put in the HTTP message body.

Always required when using the GET method. If you are using the GET method and do not specify a Form Data context record, no message is transferred to the HTTP server.

The MPL server builds formData by concatenating the individual parts.

You may use substitution variables when entering values for Form Data.

HTTP Login User The HTTP server may require authentication. Add a context record of this type to specify the login user to use.
HTTP Login Password The HTTP server may require authentication. Add a context record of this type to specify the login password to use.
HTTP Header

Sometimes the HTTP server on the other side may require the addition of HTTP headers to the message.

For each HTTP header that has to be specified you should add a context record with a value having the following format x:y where x is the header name and y is the value for the header

Character Encoding Indicates if the message should be encoded. The sender will add to the HTTP's content type header the string ;charset=x where x is the value of this context and when sending the message it will encode the data in that encoding. UTF-8 or UTF-16

Example 1

This is an example of an HTTP sender definition that connects to an external HTTP Inbound Server. The HTTP server on the other side expects a POST with some form parameters and the XML message specified in the SWEExtData form parameter. Note that @XMLMSG@ is used for the SWEExtData form parameter.

Context Type Context Value
HTTP URL1 http://<Web Server>/esales/start.swe
HTTP Method POST
HTTP Transport Method sendReceive
HTTP Form Data SWEExtSource=<Source Name>
HTTP Form Data SWEExtCmd=<Execute>
HTTP Form Data SWEExtData=@XMLMSG@
HTTP Form Data UserName=SADMIN
HTTP Form Data Password=SADMIN

Example 2

This is an example of an HTTP sender definition that connects to a third party web service.

Context Type Context Value
HTTP Header Content-Type:text/xml
HTTP Header SOAPAction:http://mwm.splwg.com/WebServices/Submit
HTTP Method POST
HTTP Transport Method sendReceive
HTTP URL1 http://10.10.17.138/SPLMWMService
HTTP URL2 /SPLMWMService.asmx