org.ksoap2.servlet
Class SoapServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.ksoap2.servlet.SoapServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SoapServlet
extends javax.servlet.http.HttpServlet

copy-paste seans interop server orb here as needed.... some design issues: - path and soapaction are not considered. soapaction is deprecated; for multiple paths, please use multiple servlets.

See Also:
Serialized Form

Constructor Summary
SoapServlet()
           
 
Method Summary
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          In order to filter requests, please overwrite doPost and call super for soap requests only
 SoapSerializationEnvelope getEnvelope()
           
 void publishClass(java.lang.Class service, java.lang.String namespace)
          Publish all public methods of the given class
 void publishInstance(java.lang.String path, java.lang.Object instance)
          publish an instance by associating the instance with the given local path.
 void publishMethod(java.lang.Class service, java.lang.String namespace, java.lang.String name, PropertyInfo[] parameters)
          publish a method.
 void publishMethod(java.lang.Class service, java.lang.String namespace, java.lang.String name, java.lang.String[] parameterNames)
          convenience method; use this method if the paremeter types can be obtained via reflection
 void setEnvelope(SoapSerializationEnvelope envelope)
          Please note: The classMap should not be set after publishing methods, because parameter type information may get lost!
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapServlet

public SoapServlet()
Method Detail

publishClass

public void publishClass(java.lang.Class service,
                         java.lang.String namespace)
Publish all public methods of the given class


publishInstance

public void publishInstance(java.lang.String path,
                            java.lang.Object instance)
publish an instance by associating the instance with the given local path. Please note that (currently) also the methods need to be published separateley. Alternatively to this call, it is also possible to overwrite the getObject (HttpRequest request) method


publishMethod

public void publishMethod(java.lang.Class service,
                          java.lang.String namespace,
                          java.lang.String name,
                          PropertyInfo[] parameters)
publish a method. Please note that also a corresponding instance needs to be published, either calling publishInstance or by overwriting getInstance (), except when the method is a method of the servlet itself.


publishMethod

public void publishMethod(java.lang.Class service,
                          java.lang.String namespace,
                          java.lang.String name,
                          java.lang.String[] parameterNames)
convenience method; use this method if the paremeter types can be obtained via reflection


getEnvelope

public SoapSerializationEnvelope getEnvelope()

setEnvelope

public void setEnvelope(SoapSerializationEnvelope envelope)
Please note: The classMap should not be set after publishing methods, because parameter type information may get lost!


doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws javax.servlet.ServletException,
                   java.io.IOException
In order to filter requests, please overwrite doPost and call super for soap requests only

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException