We having performance issues in the SOAP webservice. The webservice is built with Spyne.
I think that the problem can be solved to change the interfaces that the interfaces will only return the necessary data, because we sending large soap objects to the client.
Example:
We having a Fabric soap object with a lot of properties, see below:
class Fabric(ComplexModel):
__namespace__ = 'vadain.webservice.curtainconfig'
id = Mandatory.Integer
"Fabric ID"
articleNumber = String
"Article Number"
name = Mandatory.Unicode
"Fabric Name"
color = Mandatory.Unicode
"Color"
width = Float
"Fabric Width"
widthType = WidthType
"Width Type"
supplier = Mandatory.Unicode
supplierId = Integer
"Supplier"
ETC.
And much more!!
We have implemented two interfaces searching fabrics and get fabric, see below:
Search fabrics:
@rpc(Unicode, _returns=soap.Fabric.customize(max_occurs='unbounded'))
def fabricsWithName(ctx, name):
--Code to get all fabrics with name
return fabrics
Get fabric:
@rpc(Integer, _returns=soap.Fabric)
def getFabric(ctx, fabric_id):
--Code to get fabric from ID
return fabric
The interface of searing fabrics is returning all the properties of the fabrics, but this is not necessary. It can be changed that only the fabric name and id will be returned.
How can I change this in a good way that the interface 'fabricsWithName' will only return the fabric name and id and will this solve the performance issue?