Skip to main content
Version: 10.0

wsclient

The wsclient (web service client) libraries provide a standard implementation base for your own custom webPDF-client development in different programming languages.

A wsclient library simplifies and optimizes access to the webPDF REST- and SOAP-API:

  • It simplifies establishing a session (HTTP / HTTPS) with the webPDF server, providing the means to authenticate/authorize such a session automatically.
  • It automatically serializes and deserializes XML/JSON parameters and payloads from and to objects. You can concentrate on implementing the functionality, instead of parsing messages.
  • It abstracts the different functions and endpoints of your webPDF server to simple interface types, that allow interactions in an object-oriented manner.

Supported languages

The wsclient is currently available for the following programming languages:

Limitations

A wsclient library shall offer common, ready-to-use APIs for both REST and SOAP and shall standardize the behaviour of the REST and SOAP API wherever possible.

info

Some aspects of the SOAP and REST API can not be generalized - e.g. the webPDF server will never provide a "document manager" for a SOAP "session", which therefore also is a limitation for a wsclient library.

caution

For language specific reasons aspects of a wsclient may deviate from the statements made here. i.e. The typescript wsclient will most likely never support SOAP web service calls.

Generalized Usage Pattern

Each wsclient library shall reduce web service calls to a number of simple, linear steps, that shall work mostly the same - no matter which language is used.

Our goal is: Once you implemented a wsclient based application in one language, you should be able to apply the same pattern to all other supported languages.

Defining the SessionContext

In the first step you configure a SessionContext, which customizes your session with the webPDF server.

  • You set the protocol you intend to use (SOAP/REST).
  • You select the Port and URL of the webPDF server you want to connect to.
  • You can set a TLSContext to establish secured HTTPS connections.
  • You can provide a client truststore, further securing your connection.
  • You can configure a client side proxy server, via which your connection shall be routed.

Defining the AuthProvider

Next you select the method you want to use, to authorize your session, by selecting an AuthProvider:

  • You may use a classic user authentication
  • An OAuth2 JWT token based authorization
  • Or an Anonymous session

According to the requirements of your webPDF server.

Establishing the Session

A wsclient shall use the defined SessionContext and AuthProvider to establish the connection to the webPDF server.

This task shall be solved via a SessionFactory, that you can use to produce a Session instance, with which you interact for all your further instructions to the server.

Using the REST DocumentManager

The Session allows access to a DocumentManager for REST-clients, which enables you to upload and download documents to and from the document-storage. It also allows to manage your document-storage (rename documents, delete documents, etc.) and to access the history of your documents.

Creating and using a Webservice interface

You can then use the wsclient Session to create a Webservice interface type for the web service you want to call (e.g. it provides an interface for the "Converter" web service).

Parameterizing your web service call

The produced Webservice interface shall allow to set and customize the parameters of a web service call, using an object based parameter tree.

It shall also offer "process" methods, starting the execution of your web service call.

Payload/Response abstraction

Finally, the wsclient shall automatically translate the incoming and outgoing payloads and possibly occurring server fail-states to Document and Exception objects.

Documents shall allow accessing information about the server´s documents and -more importantly- shall organize writing the resulting documents to some target of your choice.

Exceptions shall provide simple means to access information about the fail-state that occurred, simplifying the interpretation and debugging of errors.