httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rudolf Bargholz <bargh...@onlinetravel.ch>
Subject [users@httpd] RequestHeader, SetEnvIf: Setting a missing RequestHeader
Date Fri, 30 Mar 2012 12:16:33 GMT
Hi,

After googling and experimenting all morning, perhaps some kind soul would be willing to help.

We have a web service that is routed through an Apache 2.2 on Windows. A correct SOAP Request
would be

POST http://myapache/cgi-bin/nph-owscgi.exe/olt_web/oltlogon HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://127.0.0.1:5912"

<soapenv:Envelope ...>
...
</soapenv:Envelope>

Note the SOAPAction RequestHeader. This tells the "nph-owscgi.exe" where to send the request
so that the application server can process the request.

Some customers do not send us a SOAPHeader. In this case we would like to automatically set
the SOAPHeader RequestHeader value.

Here an example of a Reqeust without a SOAPHeader:

POST http://myapache/cgi-bin/nph-owscgi.exe/olt_web/oltlogon HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""

<soapenv:Envelope ...>
...
</soapenv:Envelope>

or

POST http://myapache/cgi-bin/nph-owscgi.exe/olt_web/oltlogon HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8

<soapenv:Envelope ...>
...
</soapenv:Envelope>

Goal: to automatically set the SOAPAction if empty or missing.

Here what I would expect to work, but does not.

<Files "nph-owscgi.exe">
  SetEnvIf SOAPAction ^h.*$ HAVE_SOAPAction
  RequestHeader set SOAPAction "http://127.0.0.1:5912" env=!HAVE_SOAPAction
</Files>

What I am trying to tell Apache is, if the SOAPAction RequestHeader starts with an "h", then
set the environment variable HAVE_SOAPAction. If the environment variable HAVE_SOAPAction
is not set, then set the SOAPAction ReqeustHeader to the default value of "http://127.0.0.1:5912".

Tried other

Unfortunately this is not working. The SOAPAction is always being overwritten, not just if
empty or missing from the request headers.

Any tips what I am doing wrong?

Regards

Rudolf

Mime
View raw message