Custom http headers
I'm invoking an Authentication Webservice that has two operations: status and login.
The login invocation must use the cookie returned by the http headers (Set-Cookie) of status invocation but I'm having some problems customizing the http headers.
I followed the instrutions in these blogs:
1. http://clemensblog.blogspot.com/2006/02/consuming-statefull-webservices-from.html
2. http://www.oracle.com/technology/products/ias/bpel/htdocs/callingstatefulwsfrombpel.html
So I created two java classes: InboundHandlerForCookieRetrieval.java and OutboundHandlerForSendingState.java. After compiling these classes and putting them into $BPEL_HOME/system/classes, I changed my partnerLinkBinding:
<partnerLinkBinding name="Authentication">
<property name="wsdlLocation">Authentication.wsdl</property>
<property name="httpKeepAlive">true</property>
<property name="requestHeaderHandlers">com.otn.samples.statehandler.OutboundHandlerForSendingState</property>
<property name="responseHeaderHandlers">com.otn.samples.statehandler.InboundHandlerForCookieRetrieval</property>
</partnerLinkBinding>
But when I initiate the process in bpel console it returns the following error:
env:Server
java.lang.ClassCastException: com.otn.samples.statehandler.OutboundHandlerForSendingState
In logs:
An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "java.lang.ClassCastException: com.otn.samples.statehandler.OutboundHandlerForSendingState
at com.collaxa.cube.ws.WSIFInvocationHandler.invokeRequestHeaderHandlers(WSIFInvocationHandler.java:1415)
...
Error while invoking bean "delivery": com.otn.samples.statehandler.OutboundHandlerForSendingState
java.lang.ClassCastException: com.otn.samples.statehandler.OutboundHandlerForSendingState
at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:109)
I want to do this:
a) on inbound (response from the partnerlink)
- get the session cookie, and store it in the partnerlink
- force the session to stay alive by setting keep-alive
b) on outbound calls (requests)
- get the cookie from the partnerlink, and store it in the request, with
the right key
What is the problem of this solution? Is there a better way to customize http headers in Oracle Soa Suite 10.1.3.1.0?
Thank you.