Skip to content


SOAP utility exposes web services frameowrk for manipulating SOAP messages, making calls to external end-points and creating simple web services

Basic Usage

var soap = require("net/v4/soap");
var response = require('http/v4/response');

response.setContentType("text/plain; charset=UTF-8");

var requestMessage = soap.createMessage();
var part = requestMessage.getPart();
var envelope = part.getEnvelope();
envelope.addNamespaceDeclaration("ws", "");
var body = envelope.getBody();
var resolveIPElement = body.addChildElement("ResolveIP", "ws");
var ipAddressElement = resolveIPElement.addChildElement("ipAddress", "ws");
var licenseKeyElement = resolveIPElement.addChildElement("licenseKey", "ws");

var mimeHeaders = requestMessage.getMimeHeaders();
mimeHeaders.addHeader("SOAPAction", "");;
response.println("Request: " + requestMessage.getText());

var responseMessage =, "");

response.println("Response: " + responseMessage.getText());



Function Description Returns
createMessage() Creates an empty SOAP Message Message
parseMessage(mimeHeaders, inputStream) Creates a message by a given MIME Headers and by parsing of the provided input stream Message
parseRequest() Creates a message by parsing the standard Request input and empty headers Message
createMimeHeaders() Creates an empty MimeHeaders MimeHeaders
call(request, url) Calls an end-point of a SOAP Web Service with a request Message and returns the response Message Message



Function Description Returns
getMimeHeaders() Returns the MimeHeaders object of this Message MimeHeaders
getPart() Returns the Part object of this Message Part
save() Save the changes made on the Message and its components -
getText() Returns a text representation of the Message string


Function Description Returns
addHeader(name, value) Creates and add a new MIME header -


Function Description Returns
getEnvelope() Returns the Envelope object of this Part Envelope


Function Description Returns
getBody() Returns the Body object of this Envelope Body
getHeader() Returns the Header object of this Envelope Header
addNamespaceDeclaration(prefix, uri) Creates and add a namespace attribute -
createName(localName, prefix, uri) Creates a Name object to be used further Name


Function Description Returns
getChildElements() Returns an array of the child Elements [Element]
addChildElement(localName, prefix) Creates and add a child Element Element
Function Description Returns
addHeaderElement(name) Creates and add a Header Element with a Name Element


Function Description Returns
getLocalName() Returns the Local Name of the Name object string
getPrefix() Returns the Prefix of the Name object string
getQualifiedName() Returns the Qualified Name of the Name object string
getURI() Returns the URI of the Name object string


Function Description Returns
getChildElements() Returns an array of the child Elements [Element]
getElementName() Returns the name of the Element Name
getValue() Returns the value of the Element if any string
addChildElement(localName, prefix) Creates and add a child Element Element
addTextNode(text) Creates and add a text node Element
addAttribute(name, value) Creates and add an attribute Element
isSOAPElement() Returns true if the Element is SOAP Element and false otherwise (e.g. CDATA, PDATA, etc.) string