Now that we have defined the service's interface, we need to generate the Python skeleton of that interface. This skeleton will need to know what its own name is and what types of messages to accept, in this sense binding the abstract interface to a particular runnable instance. In order to do this, you will need to run the Python wsdl2web.py script, which will set up a new site.
Copy and paste the WSDL presented above to a file called SimpleMath.wsdl.
Create the new Site.
% mkdir /tmp/SimpleMathSite % cp SimpleMath.wsdl /tmp/SimpleMathSite % cd /tmp/SimpleMathSite % wsdl2web.py SimpleMath.wsdl --script=client.py /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ZSI-2.0_rc2-py2.4.egg/ZSI/generate/wsdl2dispatch.py:436: UserWarning: Port(MathPort) operation(add) in Binding(MathBinding) soapAction() != WS-Action(http://www.globus.org/namespaces/examples/core/MathService_instance/MathPortType/addRequest)/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ZSI-2.0_rc2-py2.4.egg/ZSI/generate/wsdl2dispatch.py:436: UserWarning: Port(MathPort) operation(subtract) in Binding(MathBinding) soapAction() != WS-Action(http://www.globus.org/namespaces/examples/core/MathService_instance/MathPortType/subtractRequest) /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ZSI-2.0_rc2-py2.4.egg/ZSI/generate/wsdl2dispatch.py:436: UserWarning: Port(MathPort) operation(getValueRP) in Binding(MathBinding) soapAction() != WS-Action(http://www.globus.org/namespaces/examples/core/MathService_instance/MathPortType/getValueRPRequest) /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pyGridWare-1.2.0rc3-py2.4.egg/pyGridWare/utility/generate/Utility.py:47: UserWarning: portType(MathPortType) does not have a ResourceProperties declaration
![]()
After the script has finished there will be several new files:
% ls SimpleMath.wsdlclient.py
generated
server-config.tac
server-config.txt
start-container.sh
![]()
The generated service generated/SimpleMath/services/SimpleMath/MathService.py needs to be added to in order to make the service actually do what it promised to do, i.e. add an subtract integers. Because the service does not have a WSRP ResourceProperties declaration state will have to be managed by the service directly.