Qore jni Module  1.0.1
org.qore.lang.soapclient.SoapClient Class Reference

Java wrapper for the SoapClient.SoapClient class in Qore. More...

Inheritance diagram for org.qore.lang.soapclient.SoapClient:
org.qore.lang.HTTPClient org.qore.jni.QoreObjectWrapper

Public Member Methods

 SoapClient (Map< String, Object > h) throws Throwable
 creates the object based on a WSDL which is parsed to a WebService object which provides the basis for all communication with this object More...
 
Object callOperation (String operation, Object args, Map< String, Object > opts) throws Throwable
 makes a server call with the given operation, arguments, options, and optional info hash reference and returns the result More...
 
HashMap< String, Object > getInfo () throws Throwable
 returns a hash of information about the current WSDL More...
 
void setSendEncoding (String enc) throws Throwable
 change the data content encoding (compression) option for the object; see EncodingSupport for valid options More...
 
void setContentEncoding (String enc) throws Throwable
 sets the request and desired response encoding for the object; see EncodingSupport for valid options More...
 
void addDefaultHeaders (Map< String, Object > h) throws Throwable
 adds default headers to each request; these headers will be sent in all requests but can be overridden in requests as well More...
 
HashMap< String, Object > getDefaultHeaders () throws Throwable
 returns the hash of default headers to sent in all requests More...
 
String getSendEncoding () throws Throwable
 returns the current data content encoding (compression) object or nothing if no encoding option is set; see EncodingSupport for valid options More...
 
void log (String msg) throws Throwable
 sends a log message to the log closure or call reference, if any
 
void dbglog (String msg) throws Throwable
 sends a log message to the debug log closure or call reference, if any
 
- Public Member Methods inherited from org.qore.lang.HTTPClient
 HTTPClient (QoreObject ds)
 creates the object
 
 HTTPClient (Map< String, Object > opts) throws Throwable
 Creates the HTTPClient object based on the option parameter passed. More...
 
void setHTTPVersion (String ver) throws Throwable
 Sets the HTTP protocol version string for headers in outgoing messages, allowed values are "1.0" and "1.1". More...
 
String getHTTPVersion () throws Throwable
 Returns the HTTP protocol version string used in outgoing messages. More...
 
void setSecure (boolean secure) throws Throwable
 Sets the object to make a secure SSL/TLS connection on the next connect if the passed argument is true, or an unencrypted cleartext connection if it is false. More...
 
boolean isSecure () throws Throwable
 Returns true if the current connection is encrypted, false if not. More...
 
void connect () throws Throwable
 Connects to the remote socket; SSL/TLS negotiation is performed if required. More...
 
void disconnect () throws Throwable
 Disconnects from the remote socket if a connection is established (otherwise does nothing) More...
 
HashMap< String, Object > send (String body, String method, String path, Map< String, Object > headers, boolean getbody) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (String body, String method, String path, Map< String, Object > headers) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (String body, String method, String path) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (String body, String method) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (byte[] body, String method, String path, Map< String, Object > headers, boolean getbody) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (byte[] body, String method, String path, Map< String, Object > headers) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (byte[] body, String method, String path) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
HashMap< String, Object > send (byte[] body, String method) throws Throwable
 Sends an HTTP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. More...
 
String get (String path, Map< String, Object > headers) throws Throwable
 Sends an HTTP GET request and returns the message body received as a string or null if no message body is received. More...
 
String get (String path) throws Throwable
 Sends an HTTP GET request and returns the message body received as a string or null if no message body is received. More...
 
String head (String path, Map< String, Object > headers) throws Throwable
 Sends an HTTP HEAD request and returns as hash of the headers received. More...
 
String head (String path) throws Throwable
 Sends an HTTP HEAD request and returns as hash of the headers received. More...
 
String post (String path, String body, Map< String, Object > headers) throws Throwable
 Sends an HTTP POST request with a message body and returns the message body received as a string or null if no message body is received. More...
 
String post (String path, String body) throws Throwable
 Sends an HTTP POST request with a message body and returns the message body received as a string or null if no message body is received. More...
 
String post (String path) throws Throwable
 Sends an HTTP POST request without a message body and returns the response message body received as a string or null if no message body is received. More...
 
String post (String path, byte[] body, Map< String, Object > headers) throws Throwable
 Sends an HTTP POST request with a message body and returns the message body received as a string or null if no message body is received. More...
 
String post (String path, byte[] body) throws Throwable
 Sends an HTTP POST request with a message body and returns the message body received as a string or null if no message body is received. More...
 
void setTimeout (int timeout_ms) throws Throwable
 Sets the default I/O timeout value in milliseconds. More...
 
int getTimeout () throws Throwable
 Returns the default I/O timeout as an integer in milliseconds. More...
 
void setEncoding (String encoding) throws Throwable
 Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding. More...
 
String getEncoding () throws Throwable
 Returns the character encoding used for the object. More...
 
void setURL (String url) throws Throwable
 Sets a new URL value for the next connection. More...
 
String getURL () throws Throwable
 Returns the current URL. More...
 
void setProxyURL () throws Throwable
 Clears the new proxy URL value for the next connection. More...
 
void setProxyURL (String url) throws Throwable
 Sets a new proxy URL value for the next connection. More...
 
String getProxyURL () throws Throwable
 Returns the current proxy URL as a string or null if no proxy URL is set. More...
 
void clearProxyURL () throws Throwable
 Clears the new proxy URL value for the next connection. More...
 
void setProxySecure (boolean b) throws Throwable
 Sets the SSL/TLS flag for the next connection to the proxy. More...
 
boolean isProxySecure () throws Throwable
 Returns the SSL/TLS flag for the next proxy connection. More...
 
void setMaxRedirects (int mr) throws Throwable
 Updates the setting for the max_redirects value for the object (maximum number of HTTP redirects that will be processed before an exception is raised) More...
 
int getMaxRedirects () throws Throwable
 Returns the current max_redirects value for the object (the maximum number of HTTP redirects that will be processed before an exception is raised) More...
 
void setConnectTimeout (int timeout_ms) throws Throwable
 Sets the connect timeout in milliseconds. More...
 
int getConnectTimeout () throws Throwable
 Returns the connect timeout as an integer in milliseconds. More...
 
int setNoDelay (boolean b) throws Throwable
 Sets the TCP_NODELAY setting for the object. More...
 
boolean getNoDelay () throws Throwable
 Returns the TCP_NODELAY setting for the HTTPClient object. More...
 
boolean isConnected () throws Throwable
 Returns true or false giving the current connection state. More...
 
void setUserPassword (String user, String pass) throws Throwable
 Sets the username and password for the connection; call after HTTPClient::setURL() More...
 
void setUserPassword () throws Throwable
 Clears the username and password for the connection. More...
 
void clearUserPassword () throws Throwable
 Clears the username and password for the connection. More...
 
void setProxyUserPassword (String user, String pass) throws Throwable
 Sets the username and password for the connection to the proxy; call after HTTPClient::setProxyURL() More...
 
void setProxyUserPassword () throws Throwable
 Clears the username and password for the next proxy connection. More...
 
void clearProxyUserPassword () throws Throwable
 Clears the username and password for the next proxy connection. More...
 
void setDefaultPath (String path) throws Throwable
 Sets the default path used by the object if no path is set in the URL. More...
 
String getDefaultPath () throws Throwable
 Returns the default path used by the object if no path is set in the URL. More...
 
String getConnectionPath () throws Throwable
 Returns the current connection path set in the URL. More...
 
HashMap< String, Object > getUsageInfo () throws Throwable
 Returns performance statistics for the socket. More...
 
void clearStats () throws Throwable
 Clears performance statistics. More...
 
void setPersistent () throws Throwable
 temporarily disables implicit reconnections; must be called when the server is already connected More...
 
- Public Member Methods inherited from org.qore.jni.QoreObjectWrapper
 QoreObjectWrapper (QoreObject obj)
 creates the wrapper object with the Qore object
 
void release ()
 releases the Qore object; do not call any further methods on the object after this call
 
QoreObject getQoreObject ()
 returns the Qore object
 
String className ()
 returns the class name for the Qore object
 
boolean instanceOf (String class_name)
 returns true if the object is an instance of the given class
 

Additional Inherited Members

- Private Attributes inherited from org.qore.jni.QoreObjectWrapper
QoreObject obj
 the wrapper Qore object
 

Detailed Description

Java wrapper for the SoapClient.SoapClient class in Qore.

Note
Loads and initializes the Qore library and the jni module in static initialization if necessary

Constructor & Destructor Documentation

◆ SoapClient()

org.qore.lang.soapclient.SoapClient.SoapClient ( Map< String, Object >  h) throws Throwable
inline

creates the object based on a WSDL which is parsed to a WebService object which provides the basis for all communication with this object

one of either the wsdl or wsdl_file keys is required in the hash given to the constructor or an exception will be thrown

Parameters
hvalid option keys:
  • wsdl: the URL of the web service or a WebService object itself
  • wsdl_file: a path to use to load the WSDL and create the WebService object
  • url: override the target URL given in the WSDL
  • send_encoding: a send data encoding option or the value "auto" which means to use automatic encoding; if not present defaults to no content-encoding on sent message bodies
  • content_encoding: for possible values, see EncodingSupport; this sets the send encoding (if the "send_encoding" option is not set) and the requested response encoding
  • [service]: in case multiple service entries are found in the WSDL, give the one to be used here
  • [port]: in case multiple port entries are found in the WSDL, give the one to be used here; note that the SOAP binding is resolved from the service and port options.
  • [log]: a log closure or call reference taking a single string giving the log message
  • [dbglog]: a log closure or call reference taking a single string giving the debug log message
  • also all options from SoapClient::HTTPOptions, which are passed to HTTPClient::constructor()

Member Function Documentation

◆ addDefaultHeaders()

void org.qore.lang.soapclient.SoapClient.addDefaultHeaders ( Map< String, Object >  h) throws Throwable
inline

adds default headers to each request; these headers will be sent in all requests but can be overridden in requests as well

Example:
// disable gzip and bzip encoding in responses
soap.addDefaultHeaders(hdrs);
Parameters
ha hash of headers to add to the default headers to send on each request
Note
default headers can also be set in the constructor
See also
getDefaultHeaders()

◆ callOperation()

Object org.qore.lang.soapclient.SoapClient.callOperation ( String  operation,
Object  args,
Map< String, Object >  opts 
) throws Throwable
inline

makes a server call with the given operation, arguments, options, and optional info hash reference and returns the result

Parameters
operationthe SOAP operation to use to serialize the request; if the operation is not known to the underlying WebService class, an exception will be thrown
argsthe arguments to the SOAP operation
optsan optional hash of options for the call as follows:
  • soap_header: a hash giving SOAP header information, if required by the message
  • http_header: a hash giving HTTP header information to include in the message (does not override automatically-generated SOAP message headers)
  • xml_opts: an integer XML generation option code; see xml_generation_constants for possible values; combine multiple codes with binary or (|)
  • soapaction: an optional string that will override the SOAPAction for the request; en empty string here will prevent the SOAPAction from being sent
  • binding: the SOAP binding name, if not provided the first binding assigned to the operation will be used
Returns
a hash with the following keys:
  • hdr: a hash of message headers
  • body: the serialized message body
Exceptions
WSDL-OPERATION-ERRORthe operation is not defined in the WSDL
WSDL-BINDING-ERRORthe binding is not assigned to a SOAP operation in the WSDL
HTTP-CLIENT-RECEIVE-ERRORthis exception is thrown when the SOAP server returns an HTTP error code; if a SOAP fault is returned, then it is deserialized and returned in the arg key of the exception hash
Note
this method can throw any exception that HTTPClient::send() can throw as well as any XML parsing errors thrown by parse_xml()

◆ getDefaultHeaders()

HashMap<String, Object> org.qore.lang.soapclient.SoapClient.getDefaultHeaders ( ) throws Throwable
inline

returns the hash of default headers to sent in all requests

Example:
HashMap<String, Object> h = soap.getDefaultHeaders();
Returns
the hash of default headers to sent in all requests
Note
default headers can be set in the constructor and in addDefaultHeaders()
See also
setDefaultHeaders()

◆ getInfo()

HashMap<String, Object> org.qore.lang.soapclient.SoapClient.getInfo ( ) throws Throwable
inline

returns a hash of information about the current WSDL

Returns
a hash with the following keys:
  • "service": the name of the SOAP service used
  • "pore": the name of the SOAP port used
  • "binding": the name of the binding used
  • "url": the target URL

◆ getSendEncoding()

String org.qore.lang.soapclient.SoapClient.getSendEncoding ( ) throws Throwable
inline

returns the current data content encoding (compression) object or nothing if no encoding option is set; see EncodingSupport for valid options

Example:
String ce = soap.getSendEncoding();
Returns
the current data content encoding (compression) object or nothing if no encoding option is set; see EncodingSupport for valid options
See also

◆ setContentEncoding()

void org.qore.lang.soapclient.SoapClient.setContentEncoding ( String  enc) throws Throwable
inline

sets the request and desired response encoding for the object; see EncodingSupport for valid options

Example:
soap.setContentEncoding("gzip");
Parameters
encthe data content encoding (compression) option for requests and the desired response content encoding for the object; see EncodingSupport for valid options; if the value "auto" is passed then "gzip" encoding is used for outgoing requests and requested for responses
Exceptions
SOAPCLIENT-ERRORinvalid or unsupported data content encoding / compression option
See also
Since
SoapClient 0.2.4

◆ setSendEncoding()

void org.qore.lang.soapclient.SoapClient.setSendEncoding ( String  enc) throws Throwable
inline

change the data content encoding (compression) option for the object; see EncodingSupport for valid options

Example:
sc.setSendEncoding("gzip");

The default is to send requests unencoded/uncompressed.

Parameters
encthe data content encoding (compression) option for the object; see EncodingSupport for valid options; if the value "auto" is passed then "gzip" encoding is used
Exceptions
SOAPCLIENT-ERRORinvalid or unsupported data content encoding / compression option
See also

The documentation for this class was generated from the following file: