swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

wsb.set-request-header

 
 

Library: Web Services Broker (OMWSB)
Import: omwsb.xmd

Declaration

export external function set-request-header
   of                 value request     request
   to                 value  string     header


Argument definitions

request
The wsb.request OMX value containing the request header to be set.
header
The value of the header to be set.


Purpose

The wsb.set-request-header function sets the header value of the wsb.request object to the specified string value. This function is used to make sure that forwarded requests are sent to the right program for processing.

Example

This example shows how to reroute a SOAP request to a service called DoCalc. The program waits for the request, then fetches the request object's header and rewrites the SOAPAction header tupple to point to DoCalc. Then the program sets the request object's header using the wsb.set-request-header function to the new value. Then the program forwards the request using the function wsb.forward-request. Finally the function loops and waits for the next request for it to forward.

  import 'omwsb.xmd' prefixed by wsb.
  
  process
     repeat
        local stream head
        local wsb.request req
        
        set req to wsb.wait-for-request
        open head as buffer
        using output as head 
          submit wsb.request-header of req
        close head
        wsb.set-request-header of req to head  
        wsb.forward-request req      
        catch #external-exception identity catch-id
           rethrow when catch-id = "OMWSB000"
     again
  
  catch #external-exception
  
  
  find "SOAPAction: " any ++ "%13#%10#"
     output "SOAPAction: %"http://DoCalc%"%13#%10#"   

    Related Syntax
   wsb.request-header
   wsb.wait-for-request
   wsb.forward-request
 
  Other Library Functions
   wsb.add-service
   wsb.clear-all-services
   wsb.create-server
   wsb.dispatch-request
   wsb.forward-request
   wsb.has-known-request-type
   wsb.reader
   wsb.read-service-arguments
   wsb.remove-service
   wsb.request
   wsb.request-header
   wsb.request-name
   wsb.request-type
   wsb.server
   wsb.service-exists
   wsb.set-request-header
   wsb.start-servicing-requests
   wsb.wait-for-request
   wsb.writer
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.