# Smart Card Shell

- - Home
- - GPError
  - GPSystem
  - ByteString
  - ByteBuffer
  - TLV
  - TLVList
  - Card
  - Atr
  - Key
  - Crypto
  - Application
  - GPApplication
  - GPSecDomain
- - ASN1
  - CardFile
  - IsoSecureChannel
  - ApplFactory
  - GPXML
  - JsScript
  - CardSim
- - X509
  - CRL
  - KeyStore
  - Signed CMS
  - Enveloped CMS
  - CMS Generator
  - XMLSignature
  - SSS
  - OCSPQuery
  - LDAP
  - SOAP
  - URLConnection
- - PKCS11Provider
  - PKCS11Session
  - PKCS11Object
- - OutlineNode
  - Dialog
  - Task
- - Tools
  - Modules
- - OpenSCDP

# SOAPConnection - Reference Documentation

Class implementing a SOAP Connection object used to call SOAP WebServices

## Index of Methods

- SOAPConnection() constructor
- call()
- close()

## Constants

Type | Name | Description
--- | --- | ---
String | SOAP11 | SOAP 1.1 protocol
String | SOAP12 | SOAP 1.2 protocol

## Constructor

### Prototype

SOAPConnection()

### Description

Create a SOAPConnection object.

### Arguments

Type | Name | Description
--- | --- | ---
`String` | soapVersion | SOAP version, one of SOAPConnection.SOAP11 or SOAP12. Default is SOAP12

### Exceptions

Name | Value | Description
--- | --- | ---
GPError | GPError.ARGUMENTS_MISSING | Too few arguments in call
GPError | GPError.INVALID_ARGUMENTS | Too many arguments in call
GPError | GPError.INVALID_TYPE | Type of argument is invalid for call

### Example

    var soapConnection = new SOAPConnection(SOAPConnection.SOAP12);

## call()

### Prototype

XML call(String url, XML soapBodyElement)

XML call(URLConnection urlconnection, XML soapBodyElement)

### Description

Create a SOAP message with the given element in the SOAP body.

Submit the message to the service endpoint and receive response.

The service endpoint can be specified either using a string with the URL or by using a preconfigured URLConnection instance. The later is useful, if additional connection parameters like timeouts or TLS keystores need to be specified.

### Arguments

Type | Name | Description
--- | --- | ---
`String` | url | The URL of the service endpoint
`URLConnection` | urlconnection | The URLConnection object
`XML` | soapMessage | The element in the SOAP body

### Return

`` |

### Exceptions

Name | Value | Description
--- | --- | ---
GPError | GPError.ARGUMENTS_MISSING | Too few arguments in call
GPError | GPError.INVALID_ARGUMENTS | Too many arguments in call
GPError | GPError.INVALID_TYPE | Type of argument is invalid for call

### Example

    var typ = new Namespace("urn:test/types");

    var request =
    			<typ:ConvertRequest xmlns:typ="urn:test/types">
    				<id>12</id>
    				<input>cid:440510063901</input>
    			<!--You may enter ANY elements at this point-->
    			</typ:ConvertRequest>

    // Using a URL string
    var url = "http://localhost:8080/se/soap";

    var response = soapConnection.call(url, request);

    print(response);

    print(response.output);

    // Using a URLConnection
    var conn = new URLConnection("http://localhost:8080/se/soap");

    conn.setConnectTimeout(10000);	// Set timeout to 10 seconds
    conn.setReadTimeout(10000);

    var response = soapConnection.call(conn, request);

    print(response);

    print(response.output);

    // Using an URLConnection and HTTPs
    var conn = new URLConnection("https://localhost:8443/se/soap");

    var truststore = new KeyStore("SUN", "jks", "truststore", "openscdp");
    var keystore = new KeyStore("SUN", "jks", "clientkeystore", "openscdp");

    conn.setTLSKeyStores(truststore, keystore, "openscdp");

    var response = soapConnection.call(conn, request);

    print(response);

    print(response.output);

## close()

### Prototype

void close()

### Description

Close SOAP connection and free used resources.

### Return

`` |

### Exceptions

Name | Value | Description
--- | --- | ---
GPError | GPError.ARGUMENTS_MISSING | Too few arguments in call
GPError | GPError.INVALID_ARGUMENTS | Too many arguments in call
GPError | GPError.INVALID_TYPE | Type of argument is invalid for call
GPError | GPError.DEVICE_ERROR | Closing the SOAP connection failed

### Example

    soapConnection.close();

© Copyright 2003 - 2026 CardContact Systems GmbH , Minden, Germany