Hello
I have to create a SOAP client (later also a service will be needed). It is my first time so please bare with me on this one as I do not have a proper understanding of this.
If I understand the whole process it is smth like this. I send a WSDL request where URL contains "?wsdl". This way I can see all the methods provided by the server. This is called GET.
Now after that i can get a definition of an xml "envelope" with which I filter which results I want. I use POST method to call an URL - without "?wdsl" send this to some method and it should return xml with data provided?
Using app SOAPUI i get everything, but I find it impossible to get trough with any python environment.
I would like to call method getEmployed. This is the envelope
<soapenv:Header/>
<soapenv:Body>
<cet:GetEmployedElement>
<!--Zero or more repetitions:-->
<cet:GetEmployed>
<cet:OrganizationCode></cet:OrganizationCode>
<cet:LastName></cet:LastName>
<cet:FirstName></cet:FirstName>
<cet:AktCard></cet:AktCard>
<cet:JobAgreementType></cet:JobAgreementType>
<cet:Mferac></cet:Mferac>
</cet:GetEmployed>
</cet:GetEmployedElement>
</soapenv:Body>
</soapenv:Envelope>
this way I should receive all the employees
my code
xml = ("""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cet="http://xxx.yy">
<soapenv:Header/>
<soapenv:Body>
<cet:GetEmployedElement>
<!--Zero or more repetitions:-->
<cet:GetEmployed>
<cet:OrganizationCode></cet:OrganizationCode>
<cet:LastName></cet:LastName>
<cet:FirstName></cet:FirstName>
<cet:AktCard></cet:AktCard>
<cet:JobAgreementType></cet:JobAgreementType>
<cet:Mferac></cet:Mferac>
</cet:GetEmployed>
</cet:GetEmployedElement>
</soapenv:Body>
</soapenv:Envelope>
""")
from gluon.contrib.pysimplesoap.client import SoapClient, SoapFault
client = SoapClient (wsdl="https://www.xxx.yy/some/more/url?wsdl", location="https://www.xxx.yy", cacert=None, trace=True)
print client.send('getEmployed',xml=xml)
response = client.getEmployed()
print response
I get either urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
or error 405.
Any proper explanation and/or example would be good.
thank you