org.owasp.webscarab.plugin.webservice
Class WebService

java.lang.Object
  extended by org.owasp.webscarab.plugin.webservice.WebService
All Implemented Interfaces:
java.lang.Runnable, Plugin

public class WebService
extends java.lang.Object
implements Plugin

Author:
rdawes

Field Summary
static java.lang.String DEFAULT_SOAP_ENCODING_STYLE
          The default SOAP encoding to use.
static java.lang.String SOAP_NS
           
static java.lang.String XSD_NS
           
static java.lang.String XSI_NS
           
 
Constructor Summary
WebService(Framework framework)
          Creates a new instance of WebService
 
Method Summary
 void analyse(ConversationID id, Request request, Response response, java.lang.String origin)
           
 Value[] buildValues(OperationInfo operationInfo, javax.wsdl.Message msg)
          Builds and adds parameters to the supplied info object given a SOAP Message definition (from WSDL)
 Value constructValue(java.lang.String name, QName typeName)
           
protected  Schema createSchemaFromTypes(javax.wsdl.Definition wsdlDefinition)
          Creates a schema based on the types defined by a WSDL document
 void flush()
          called to instruct the plugin to flush any memory-only state to the store.
 javax.wsdl.Definition getDefinition(ConversationID id)
           
 WebServiceModel getModel()
           
 java.lang.String getPluginName()
          The plugin name
 java.lang.Object getScriptableObject()
           
 Hook[] getScriptingHooks()
           
 java.lang.String getStatus()
          called to determine what the current status of the plugin is
 javax.wsdl.Definition getWSDL(java.lang.String location)
           
 Response invokeOperation(OperationInfo operation, Value[] values)
           
 boolean isBusy()
          called to test whether the plugin is able to be stopped
 boolean isModified()
          called to determine whether the data stored within the plugin has been modified and should be saved
 boolean isRunning()
           
 void run()
          starts the plugin running
 void selectWSDL(javax.wsdl.Definition definition)
           
 void setSession(java.lang.String type, java.lang.Object store, java.lang.String session)
          informs the plugin that the Session has changed
 boolean stop()
          called to suspend or stop the plugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SOAP_ENCODING_STYLE

public static final java.lang.String DEFAULT_SOAP_ENCODING_STYLE
The default SOAP encoding to use.

See Also:
Constant Field Values

SOAP_NS

public static final java.lang.String SOAP_NS
See Also:
Constant Field Values

XSD_NS

public static final java.lang.String XSD_NS
See Also:
Constant Field Values

XSI_NS

public static final java.lang.String XSI_NS
See Also:
Constant Field Values
Constructor Detail

WebService

public WebService(Framework framework)
Creates a new instance of WebService

Method Detail

getModel

public WebServiceModel getModel()

getWSDL

public javax.wsdl.Definition getWSDL(java.lang.String location)
                              throws java.net.MalformedURLException,
                                     java.io.IOException,
                                     org.xml.sax.SAXException,
                                     javax.wsdl.WSDLException
Throws:
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException
javax.wsdl.WSDLException

analyse

public void analyse(ConversationID id,
                    Request request,
                    Response response,
                    java.lang.String origin)
Specified by:
analyse in interface Plugin

flush

public void flush()
           throws StoreException
Description copied from interface: Plugin
called to instruct the plugin to flush any memory-only state to the store.

Specified by:
flush in interface Plugin
Throws:
StoreException - if there is any problem saving the session data

getPluginName

public java.lang.String getPluginName()
Description copied from interface: Plugin
The plugin name

Specified by:
getPluginName in interface Plugin
Returns:
The name of the plugin

getScriptableObject

public java.lang.Object getScriptableObject()
Specified by:
getScriptableObject in interface Plugin

getScriptingHooks

public Hook[] getScriptingHooks()
Specified by:
getScriptingHooks in interface Plugin

getStatus

public java.lang.String getStatus()
Description copied from interface: Plugin
called to determine what the current status of the plugin is

Specified by:
getStatus in interface Plugin

isBusy

public boolean isBusy()
Description copied from interface: Plugin
called to test whether the plugin is able to be stopped

Specified by:
isBusy in interface Plugin
Returns:
false if the plugin can be stopped

isModified

public boolean isModified()
Description copied from interface: Plugin
called to determine whether the data stored within the plugin has been modified and should be saved

Specified by:
isModified in interface Plugin

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Plugin

run

public void run()
Description copied from interface: Plugin
starts the plugin running

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface Plugin

setSession

public void setSession(java.lang.String type,
                       java.lang.Object store,
                       java.lang.String session)
                throws StoreException
Description copied from interface: Plugin
informs the plugin that the Session has changed

Specified by:
setSession in interface Plugin
Throws:
StoreException

stop

public boolean stop()
Description copied from interface: Plugin
called to suspend or stop the plugin

Specified by:
stop in interface Plugin

getDefinition

public javax.wsdl.Definition getDefinition(ConversationID id)
                                    throws javax.wsdl.WSDLException,
                                           org.xml.sax.SAXException
Throws:
javax.wsdl.WSDLException
org.xml.sax.SAXException

selectWSDL

public void selectWSDL(javax.wsdl.Definition definition)
                throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

buildValues

public Value[] buildValues(OperationInfo operationInfo,
                           javax.wsdl.Message msg)
Builds and adds parameters to the supplied info object given a SOAP Message definition (from WSDL)

Parameters:
operationInfo - The component to build message text for
msg - The SOAP Message definition that has parts to defined parameters for

constructValue

public Value constructValue(java.lang.String name,
                            QName typeName)

invokeOperation

public Response invokeOperation(OperationInfo operation,
                                Value[] values)
                         throws java.net.MalformedURLException,
                                java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

createSchemaFromTypes

protected Schema createSchemaFromTypes(javax.wsdl.Definition wsdlDefinition)
Creates a schema based on the types defined by a WSDL document

Parameters:
wsdlDefinition - The WSDL4J instance of a WSDL definition.
Returns:
A schema is returned if the WSDL definition contains a types element. null is returned otherwise.