Table Of Contents

Previous topic

MessagePack

Next topic

Server Transports

This Page

Client Transports

Client Base Class

Contains the ClientBase class and its helper objects.

class spyne.client._base.ClientBase(url, app)[source]

The base class for all client applications. self.service attribute should be initialized in the constructor of the child class.

set_options(**kwargs)[source]

Sets call options.

Parameters:
  • out_header – Sets the header object that’s going to be sent with the remote procedure call.
  • soapheaders – A suds-compatible alias for out_header.
class spyne.client._base.RemoteProcedureBase(url, app, name, out_header=None)[source]

Abstract base class that handles all (de)serialization.

Child classes must implement the client transport in the __call__ method using the following method signature:

def __call__(self, *args, **kwargs):
Parameters:
  • url – The url for the server endpoint.
  • app – The application instance the client belongs to.
  • name – The string identifier for the remote method.
  • out_header – The header that’s going to be sent with the remote call.
get_in_object(ctx)[source]

Deserializes the response bytestream first as a document and then as a native python object.

get_out_object(ctx, args, kwargs)[source]

Serializes the method arguments to output document.

Parameters:
  • args – Sequential arguments.
  • kwargs – Name-based arguments.
get_out_string(ctx)[source]

Serializes the output document to a bytestream.

HTTP

The HTTP (urllib2) client transport.

class spyne.client.http.HttpClient(url, app)[source]
set_options(**kwargs)

Sets call options.

Parameters:
  • out_header – Sets the header object that’s going to be sent with the remote procedure call.
  • soapheaders – A suds-compatible alias for out_header.

ZeroMQ

The ZeroMQ (zmq.REQ) client transport.

class spyne.client.zeromq.ZeroMQClient(url, app)[source]
set_options(**kwargs)

Sets call options.

Parameters:
  • out_header – Sets the header object that’s going to be sent with the remote procedure call.
  • soapheaders – A suds-compatible alias for out_header.