• Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpServletRequest instance transmission over Apache Axis

 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to transmit an instance of HttpServletRequest to a Web service from the client side over Axis. But while transmitting, it gives me the following exception :
- Mapping Exception to AxisFault
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: java.io.IOException: No serializer found for class org.apache.cata
lina.connector.HttpRequestFacade in registry org.apache.axis.encoding.TypeMappin
gImpl@ef3ccd
faultActor: null
faultDetail:
stackTrace: java.io.IOException: No serializer found for class org.apach
e.catalina.connector.HttpRequestFacade in registry org.apache.axis.encoding.Type
MappingImpl@ef3ccd
at org.apache.axis.encoding.SerializationContextImpl.serializeActual(Ser
ializationContextImpl.java:1109)
at org.apache.axis.encoding.SerializationContextImpl.serialize(Serializa
tionContextImpl.java:684)
at org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(Ser
ializationContextImpl.java:736)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:144)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:389
)
at org.apache.axis.message.MessageElement.output(MessageElement.java:706

Please, someone let me know how to transmit the said instance over Apache Axis. I know there are some standard object types for which serializer is provided in Apache Axis. I also have some idea that I can do it using BeanSerializer but how to do it is the problem :-), pls. someone explain...
 
David Carew
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several reasons why this is a bad idea.
HttpServletRequest is an interface so you would have to provide a serializer for a specific web container implementation which you would also need at the other end.
Even if you did manage to get the HttpServletRequest instance across the wire, it probably won't be of much use. Web containers maintain a context that each HttpServletRequest instance is associated with, so your HttpServletRequest will be pretty useless outside of its original web container.
You're better off extracting the data you need and wrapping it in a data bean before making your SOAP request.
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
There must be some way to transmit HttpServletRequest object over Axis. I just need to know that. I have now added the following line in wsddd file & deployed the service :
<beanMapping qname="myNS:local" xmlns:myNS="urn:someURN" languageSpecificType="javax.servlet.http.HttpServletRequest"/>
And after that I get the following exception :
- Exception:
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: org.xml.sax.SAXException: Bad types (null -> interface javax.servl
et.http.HttpServletRequest)
faultActor: null
faultDetail:
stackTrace: org.xml.sax.SAXException: Bad types (null -> interface ja
vax.servlet.http.HttpServletRequest)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:207)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(Dese
rializationContextImpl.java:857)
If anyone has some idea reagarding this, pls. let me know.
[ August 29, 2002: Message edited by: Sam Cala ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you want is IMPOSSIBLE because a request is tightly tied to objects in your servlet engine that are NOT SERIALIZABLE.
You will have to redesign your code. What is it in the HttpServletRequest that you want to transmit?
Bill
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about if I write a searializer for HttpServletRequest class ?
If its possible this way, can somone share the possible solution with me ?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam, you CAN'T DO IT! IT'S IMPOSSIBLE! GIVE UP!
SOAP is pass-by-value, not pass-by-reference. It won't matter what you do, you can't make it pass-by-reference.
You probably don't want to do this -- you probably just want to send the data IN the HttpServlet request, right? So take the data out of the request attributes, copy it into a Hashtable and send that in the SOAP message...
Kyle
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was just giving a try !
Thanks all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!