On Mon, Sep 29, 2008 at 7:33 AM, Frank Kerr <[EMAIL PROTECTED]> wrote:
> Is it possible to create a process in ODE that will pass specified
> http headers directly through from the calling application to one or
> more of the web services that are invoked within the process?
>
Yes, you can set HTTP headers directly from the process. To do that, you
have two options:
1. you can use the HTTP-binding extensions and bind a message part to a
header. [1] In that case, simply assign your part with the desired value,
and ODE will set the HTTP header it is bound to.
2. or you can use the "<to header>" assignment:
<assign>
<copy>
<from>...</from>
<to variable="your_msg" header="your_header"/> #
your_header being an HTTP header (standard or not)
</copy>
</assign>
[1] http://ode.apache.org/user-guide.html#UserGuide-HTTPHeadersmanipulation
> Specifically, I would like to pass basic authentication details.
> I know that http authentication details can be added to the endpoint
> configuration file, but this means that the same credentials are
> passed on every call, whereas I would like the details of the user
> that has authenticated in the calling application.
So for basic auth, what you would have to do is to set the Authorization
header. The disappointing part is that you have to pass the credentials
already base64-encoded. Something like 'Basic Zm9vbGtqZGpoZmxramhzZGZraAo='
Not really neat.
But I'm about to contribute a specific mechanism for authentication. You
should be able to create a message part named WWW-Authentication containing
an element similar to:
<xs:complexType name="credentialType">
<!-- accepted scheme are Basic and Digest -->
<xs:attribute name="scheme" type="xs:string" default="server-decide" />
<xs:attribute name="username" type="xs:string" />
<xs:attribute name="password" type="xs:string" />
</xs:complexType>
<xs:element type="rest_connector:credentialType" name="credentials" />
>From this part, ODE will handle encoding and everything.
By the way, comments are welcome on this.
>
> I also noticed that there was some functionality around RESTful web
> services to get the information from a message part - but I would like
> to pass it direct from the inbound http request.
>
All HTTP response headers are set on the response message. So you can assign
from them easily.
For instance:
<assign>
<copy>
<from variable="responseMsg" header="Content-Language"/>
<to variable="nextRequestMsg" header="Accept-Language"/>
</copy>
<copy>
<from variable="responseMsg" header="Last-Modified"/>
<to>$timestamp</to>
</copy>
</assign>
I hope it helps.
Cheers,
Alexis
>
> I hope that makes some sense.
>