This is definitely a routing issue, in that non-SOAP payloads need to be
routed to a different servlet or service.
I see at least two ways to go.

1.
Assuming you can receive the payload in a handler class (without it also
throwing an exception) that gets called before the Axis engine does, you
'should' be able to modify the request completely (that is, swap in a
real soap envelope) if you see a request that is non-soap. You could
then pass the new envelope along to the Axis engine and get it processed
like any other web service request. On the way out, you have to capture
those envelopes again in the same handler class, and de-soap them to
send them back to the client. (When you create a soap envelope and add
it in, you should set a property on the MessageContext saying so, and
then in the handler on the way out you look for this property. Only
those responses with the property in the MessageContext will need
adjusting for the clients).

2.
Another way would be to route all requests to a different servlet, i.e.
servlet chaining. This other servlet sits in front of Axis servlet. It
gets all requests and looks for the ones that are non-soap and creates a
new request with a soap envelope and passes that to Axis. In this
manner, this other servlet is a client of the service. On the way back,
it gets the response envelope, and creates a new response with no soap
and sends that back to the actual client. Normal soap requests are not
really processed, just passed along.

2b.
You could also have this other servlet just implement the same interface
as the web service implementation class. That way, it wouldn't have to
try and build a full soap envelope, it would just pass the request onto
the appropriate impl method in the servlet (Axis would not see these
requests). Of course, this servlet will not have the MessageContext
available to it, or any of the other web service things. The impl class
in the web service will, however.
-jeff


-----Original Message-----
From: Andrew Martin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 22, 2007 9:45 AM
To: axis-user@ws.apache.org
Subject: Re: Challenging Problem - Help badly needed

Do the non-SOAP requests need to be sent to the same URL as the SOAP
requests?  If not, could the clients send the non-SOAP requests to a
servlet at a different URL than the Axis service?

Andrew

JavaDonkey wrote:
> Hi,
> 
> I have an axis applicaton running.  There are situations where the
clients
> will send a HTTP Post without any SOAP envelope and the application
should
> process a set of operations and send out a response.  What happens now
is
> that as Axis expects a SOAP request, it throws an exception as soon as
it
> receives this request.  I tried the following approaches.......
> 
> I tried to use a filter.  But I am not able to update the request
object
> with a soap envelope.  At the filter, one can only add
parameters(Query
> strings) to the request object.  One cannot add anything to the HTTP
body.
> 
> I tried to tackle it at my handler, after disabling the exception at
the
> AxisServlet.  But when I create SOAP message and add it to the
> MessageContext, it throws  
> java.lang.ClassCastException:
> com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl
>       at
org.apache.axis.MessageContext.setMessage(MessageContext.java:796)
> 
> I tried a lot but to no use.  Any help would be greatly appreciated.
> 
> Thanxxx

-- 
Andrew Martin
Computer Programmer
Regenstrief Institute, Inc.
410 West 10th Street, Suite 2000
Indianapolis, IN 46202-3012
Phone: (317) 423-5542
Fax: (317) 423-5695
[EMAIL PROTECTED]


Confidentiality Notice: The contents of this message and any files
transmitted with it may contain confidential and/or privileged
information and are intended solely for the use of the named
addressee(s). Additionally, the information contained herein may have
been disclosed to you from medical records with confidentiality
protected by federal and state laws. Federal regulations and State laws
prohibit you from making further disclosure of such information without
the specific written consent of the person to whom the information
pertains or as otherwise permitted by such regulations. A general
authorization for the release of medical or other information is not
sufficient for this purpose.

If you have received this message in error, please notify the sender by
return e-mail and delete the original message. Any retention,
disclosure, copying, distribution or use of this information by anyone
other than the intended recipient is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to