Prashant

You should look into the code of the RPCRouterServlet and see the chain of
calls being made to introspect the call envelope.  I think the code to
introspect the header is in the RPCRouter class.  Look into that and you
should be able to figure out how to extract the necessary values.  The
RPCJavaProvider (if ure using the default provider) should also give you
pointers.

Irfan

-----Original Message-----
From: Prashant Jain [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 27, 2001 2:22 AM
To: [EMAIL PROTECTED]
Subject: Re: using soap with tomcat 4.0b6 filter support


Hi Kartheek,

I already tried that. Unfortunately, the getHeader method on
HttpServletRequest returns an HTTP header which is different from the
SOAP headers that are inserted on the client side. The problem is that a
ServletRequest object has no notion of the structure of the data that is
contained in the request. Therefore it has no way of distinguishing
between a SOAP message or a regular XML message.

- Prashant

----- Original Message -----
From: "Kartheek Hirode" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 27, 2001 2:42 PM
Subject: RE: using soap with tomcat 4.0b6 filter support


> You could try casting the ServletRequest to a HTTPServletRequest and
> invoking getHeader(keyName) on it.
> --KH
>
> -----Original Message-----
> From: Prashant Jain [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 26, 2001 8:41 PM
> To: [EMAIL PROTECTED]
> Subject: Re: using soap with tomcat 4.0b6 filter support
>
>
> KH,
>
> > If you're using the RPCRouterServlet, then the Call object that is
> extracted
> > from the Envelope has the Headers.
> > Vector v = call.getHeader.getHeaderEntries();
>
> You are right that the header can be extracted from the Envelope I get
> when I use Message-based service. However, I want to "look" at the
> header even before it reaches the RPCRouterServlet. I want to use
Filter
> support provided by Tomcat 4.0 to intercept the requests. The Filter
can
> be installed to intercept any request _before_ it is delivered to the
> servlet.
>
> I am able to install the Filter succesfully and also intercept the
> request. But I don't know how to read the Header. Here is the method
on
> the Filter that gets called:
>
> public void doFilter(ServletRequest req, ServletResponse res,
> FilterChain filterChain)
>
> So my basic problem is how to extract the Header information given
just
> the ServletRequest object.
>
> I tried using "getInputStream()" method on the ServletRequest object
and
> am able to read the contents. However, since the inputstream has been
> "read/touched", I get the following error when the request eventually
> reaches the Servlet.
>
> Ouch, the call failed:
>   Fault Code   = SOAP-ENV:Protocol
>   Fault String = Premature end of stream. Data is truncated. Read -1
> bytes successfully, expected 1719
>
> Is there another way that I could look at the contents of a
> ServletRequest without getting this error?
>
> Any ideas/suggestions on what I could do?
>
> Thanks,
>
> - Prashant
>
> > The Header value is stored as the first child of the Element whose
> name is
> > the name you have assigned in the client.
> > See http://marc.theaimsgroup.com/?l=soap-user&m=99064627103560&w=2
for
> a
> > similar problem.
> >
> > G'luck,
> > --KH
> >
> > -----Original Message-----
> > From: Prashant Jain [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 26, 2001 5:30 AM
> > To: [EMAIL PROTECTED]
> > Subject: using soap with tomcat 4.0b6 filter support
> >
> >
> > Hi,
> >
> > Has anyone tried using SOAP with the Filter functionality of Tomcat
> 4.0
> > (beta 6)? On my client side, I am creating a SOAP header and
inserting
> > some data in it. What I would like to be able to do is to extract
this
> > data using a Filter which I install in the servlet container
(tomcat).
> >
> > I am able to intercept the request in my filter but am not sure how
to
> > extract a SOAP header given just an HttpServletRequest.
> >
> > Any help would be appreciated.
> >
> > Thanks,
> >
> > - Prashant
> >
>

Reply via email to