---
title: "WS Operation"
id: "ws-operation"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/ws-operation"
updated: 2026-12-01T00:47:46Z
---

# WS Operation

The WSOperation object holds all the operation data associated with a web service port and is available to the web service listener events via a call to event.getOperation(). It is available for more advanced usage of a web service.

## Properties

addBodyElement(bodyPart)
Description

Adds body part of the WS element to this WS operation. The WS element has a header part, a body part and the result part.
 
Syntax

**addBodyElement(bodyPart)**

* Parameters

[WSElement](/articles/user-manual/WS-Element) bodyPart - The body part of the WS element to be added.

* Returns

Nothing

* Scope

All

addHeaderElement(headerPart)
Description

Adds header part of the WS element to this WS operation.
 
Syntax

**addHeaderElement(headerPart)**

* Parameters

[WSElement](/articles/user-manual/WS-Element) headerPart - The header part of the WS element to be added.

* Returns

Nothing

* Scope

All

addResultElement(resultPart)
Description

Adds result part of the WS element to this WS operation.
 
Syntax

**addResultElement(resultPart)**

* Parameters

[WSElement](/articles/user-manual/WS-Element) resultPart - The result part of the WS element to be added.

* Returns

Nothing

* Scope

All

copy()
Description

Creates a copy of this WS operation.
 
Syntax

**copy()**

* Parameters

None

* Returns

[WSOperation](/articles/user-manual/WS-Operation) clone - The copy of this WS operation.

* Scope

All

getBodyElement()
Description

Gets the body part of the WS element associated with this WS operation.
 
Syntax

**getBodyElement()**

* Parameters

None

* Returns

[WSElement](/articles/user-manual/WS-Element) bodyElement - The body part of WS element corresponding to this web service operation.

* Scope

All

getBodyVariable()
Description

Returns the body variable of this WS operation.
 
Syntax

**getBodyVariable()**

* Parameters

None

* Returns

[WSVariable](/articles/user-manual/WS-Variable) bodyVariable - The body variable corresponding to this WS operation.

* Scope

All

getFullName()
Description

Returns the full name of this operation.
 
Syntax

**getFullName()**

* Parameters

None

* Returns

[String](/articles/user-manual/Data-Types-and-Formats) name - The full name of this WS operation.

* Scope

All

getHeadersElement()
Description

Gets the headers element associated with this WS operation.
 
Syntax

**getHeadersElement()**

* Parameters

None

* Returns

[WSElement](/articles/user-manual/WS-Element) headersElement - The headers element for this WS operation.

* Scope

All

getHeadersVariable()
Description

Returns the headers variable for this WS operation.
 
Syntax

**getHeadersVariable()**

* Parameters

None

* Returns

[WSVariable](/articles/user-manual/WS-Variable) headersVariable - The headers variable for this WS operation.

* Scope

All

getInput()
Description

Gets the input for this WS operation.
 
Syntax

**getInput()**

* Parameters

None

* Returns

[String](/articles/user-manual/Data-Types-and-Formats) input - The input for this WS operation.

* Scope

All

getName()
Description

Gets the name of this WS operation.
 
Syntax

**getName()**

* Parameters

None

* Returns

[String](/articles/user-manual/Data-Types-and-Formats) name - The name of this WS operation.

* Scope

All

getOutput()
Description

Returns the output of this WS operation.
 
Syntax

**getOutput()**

* Parameters

None

* Returns

[String](/articles/user-manual/Data-Types-and-Formats) output - The output of this WS operation.

* Scope

All

getPort()
Description

Returns the port of this WS operation.
 
Syntax

**getPort()**

* Parameters

None

* Returns

[WSPort](/articles/user-manual/WS-Port) port - The web service port to perform this operation.

* Scope

All

getResult()
Description

Gets the WS variable created by this WS operation.
 
Syntax

**getResult()**

* Parameters

None

* Returns

[WSVariable](/articles/user-manual/WS-Variable) results - The results of this WS operation.

* Scope

All

getResultsElement()
Description

Gets the result element of this operation.
 
Syntax

**getResultsElement()**

* Parameters

None

* Returns

[WSElement](/articles/user-manual/WS-Element) resultsElement - The result element of this operation.

* Scope

All

getResultsVariable()
Description

Gets the results variable of this operation.
 
Syntax

**getResultsVariable()**

* Parameters

None

* Returns

[WSVariable](/articles/user-manual/WS-Variable) resultsVariable - The results variable of this operation.

* Scope

All

getWebFault()
Description

Gets the fault associated with this web service operation.
 
Syntax

**getWebFault()**

* Parameters

None

* Returns

[String](/articles/user-manual/Data-Types-and-Formats) webFault - The message explaining the fault occurred during this web service operation.

* Scope

All

hasWebFault()
Description

Checks whether this WSOperation has any faults.
 
Syntax

**hasWebFault()**

* Parameters

None

* Returns

[String](/articles/user-manual/Data-Types-and-Formats) - True, if there exists any faults and False otherwise.

* Scope

All
setBodyElement(bodyElement)
Description

Sets the body part of the WS element associated with this WS operation.
 
Syntax

**setBodyElement(bodyElement)**

* Parameters

[WSElement](/articles/user-manual/WS-Element) bodyElement - The body part to set WS operation for.

* Returns

Nothing

* Scope

All

setBodyVariable(bodyVariable)
Description

Sets the body variable of this WS operation.
 
Syntax

**setBodyVariable(bodyVariable)**

* Parameters

[WSVariable](/articles/user-manual/WS-Variable) bodyVariable - The body variable to set WS operation for.

* Returns

Nothing

* Scope

All

setHeadersElement(headersElement)
Description

Sets the headers element associated with this WS operation.
 
Syntax

**setHeadersElement(headersElement)**

* Parameters

[WSElement](/articles/user-manual/WS-Element) headersElement - The headers element to set WS operation for.

* Returns

Nothing

* Scope

All

setHeadersVariable(headersVariable)
Description

Sets the headers variable for this WS operation.
 
Syntax

**setHeadersVariable(headersVariable)**

* Parameters

[WSVariable](/articles/user-manual/WS-Variable) headersVariable - The headers variable for this WS operation.

* Returns

Nothing

* Scope

All

setInitialized(initialized)
Description

Return true if this WS operation have been initialized.
 
Syntax

**setInitialized(initialized)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) initialized - Set to True if this WS operation have been initialized, else False.

* Returns

Nothing

* Scope

All

setInput(input)
Description

Set input for this operation.
 
Syntax

**setInput(input)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) input - The input to set for.

* Returns

Nothing

* Scope

All

setModified(modified)
Description

Sets whether this operation has been modified.
 
Syntax

**setModified(modified)**

* Parameters

[boolean](/articles/user-manual/Data-Types-and-Formats) modified - True if this operation has been modified and False otherwise.

* Returns

Nothing

* Scope

All

setName(name)
Description

Sets the name of this WS operation.
 
Syntax

**setName(name)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) name - The name of this WS operation.

* Returns

Nothing

* Scope

All

setOutput(output)
Description

Sets the output of this WS operation.
 
Syntax

**setOutput(output)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) output - The output of this WS operation.

* Returns

Nothing

* Scope

All

setPort(port)
Description

Sets the port for this WS operation.
 
Syntax

**setPort(port)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) port - The port for this WS operation.

* Returns

Nothing

* Scope

All

setResultsElement(resultsElement)
Description

Sets the result elements for this WS operation.
 
Syntax

**setResultsElement(resultsElement)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) resultsElement - The results element to set the operation for.

* Returns

Nothing

* Scope

All

setResultsVariable(resultsVariable)
Description

Sets the WS variable object that contains the results of this operation.
 
Syntax

**setResultsVariable(resultsVariable)**

* Parameters

[WSVariable](/articles/user-manual/WS-Variable) resultsVariable - The results variable to set operation for.

* Returns

Nothing

* Scope

All

setWebFault(message)
Description

Sets a message when a fault occurs in this WS operation.
 
Syntax

**setWebFault(message)**

* Parameters

[String](/articles/user-manual/Data-Types-and-Formats) message - The message to set for web faults.

* Returns

Nothing

* Scope

All

setWrapped(wrapped)
Description

Return true if this WS operation have been wrapped.
 
Syntax

**setWrapped(wrapped)**

* Parameters

[boolean](/articles/user-manual/Data-Types-and-Formats) wrapped - Set to True if this WS operation have been wrapped, else False.

* Returns

Nothing

* Scope

All

Code Example

Code

```
# Code snippet from the After Run event of a web service listener 
wsOperation = event.getOperation()
if wsOperation.hasWebFault():
   log.error(wsOperation.getWebFault())
```


 © Sepasoft. All rights reserved. 
 [Send feedback](mailto:support@clickhelp.com) on this topic to Sepasoft.