Ich habe folgendes Problem:
Ich versuche mit SOAPpy eine Nachricht an einen Document/Literal Webserver zu senden:
Code: Alles auswählen
import SOAPpy
import time
import datetime
proxy = SOAPpy.WSDL.Proxy("http://www.holidaywebservice.com/Holidays/GBNIR/GBNIRHolidayService.asmx?WSDL")
proxy.soapproxy.config.dumpSOAPOut = 1
proxy.soapproxy.config.dumpSOAPIn = 1
def exploreService():
result=proxy.methods.keys()
i=0
while i< len(result):
print result[i]
printMethods(result[i])
i=i+1
def printMethods(methodName):
callinfo= proxy.methods[methodName]
i=0
while i< len(callinfo.inparams):
print callinfo.inparams[i].name
print callinfo.inparams[i].type
i=i+1
exploreService()
def printResult(result):
i=0
while i< len(result):
print result[0]
result = proxy.GetHolidaysForYear(year=2007)
printResult(result)
Code: Alles auswählen
GetHolidaysForDateRange
parameters
(u'http://www.27seconds.com/Holidays/GBNIR/', u'GetHolidaysForDateRange')
GetHolidaysAvailable
parameters
(u'http://www.27seconds.com/Holidays/GBNIR/', u'GetHolidaysAvailable')
GetHolidayDate
parameters
(u'http://www.27seconds.com/Holidays/GBNIR/', u'GetHolidayDate')
GetHolidaysForMonth
parameters
(u'http://www.27seconds.com/Holidays/GBNIR/', u'GetHolidaysForMonth')
GetHolidaysForYear
parameters
(u'http://www.27seconds.com/Holidays/GBNIR/', u'GetHolidaysForYear')
*** Outgoing SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<GetHolidaysForYear SOAP-ENC:root="1">
<year xsi:type="xsd:int">2007</year>
</GetHolidaysForYear>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
*** Incoming SOAP ******************************************************
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --> Specified argument was out of the range of valid values.
Parameter name: Year, Month, and Day parameters describe an unrepresentable DateTime.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
************************************************************************
Traceback (most recent call last):
File "/home/Richard/workspace/WebServices/W7/myHolliday_client.py", line 29, in ?
result = proxy.GetHolidaysForYear(year=2007)
File "/usr/lib/python2.3/site-packages/SOAPpy/Client.py", line 470, in __call__
return self.__r_call(*args, **kw)
File "/usr/lib/python2.3/site-packages/SOAPpy/Client.py", line 492, in __r_call
self.__hd, self.__ma)
File "/usr/lib/python2.3/site-packages/SOAPpy/Client.py", line 406, in __call
raise p
SOAPpy.Types.faultType: <Fault soap:Server: Server was unable to process request. --> Specified argument was out of the range of valid values.
Parameter name: Year, Month, and Day parameters describe an unrepresentable DateTime.: >
Code: Alles auswählen
<!-- Anfrage durch SoapUI -->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gbs="http://www.27seconds.com/Holidays/GBSCT/">
<soapenv:Body>
<gbs:GetHolidaysForYear>
<gbs:year>2007</gbs:year>
</gbs:GetHolidaysForYear>
</soapenv:Body>
</soapenv:Envelope>
Code: Alles auswählen
<!-- Antwort durch den WS-->
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetHolidaysForYearResponse xmlns="http://www.27seconds.com/Holidays/GBSCT/">
<GetHolidaysForYearResult>
<xs:schema id="NewDataSet" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element msdata:IsDataSet="true" name="NewDataSet">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Holidays">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Name" type="xs:string"/>
<xs:element minOccurs="0" name="Key" type="xs:string"/>
<xs:element minOccurs="0" name="Date" type="xs:dateTime"/>
<xs:element minOccurs="0" name="Type" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<NewDataSet xmlns="">
<Holidays diffgr:hasChanges="inserted" diffgr:id="Holidays1" msdata:rowOrder="0">
<Name>New Year's Day</Name>
<Key>NEW_YEARS</Key>
<Date>2007-01-01T00:00:00.0000000-07:00</Date>
<Type>Bank Holiday</Type>
</Holidays>
<Holidays diffgr:hasChanges="inserted" diffgr:id="Holidays2" msdata:rowOrder="1">
<Name>2nd January</Name>
<Key>SEC_JAN</Key>
<Date>2007-01-02T00:00:00.0000000-07:00</Date>
<Type>Bank Holiday</Type>
</Holidays>
<Holidays diffgr:hasChanges="inserted" diffgr:id="Holidays3" msdata:rowOrder="2">
<Name>Good Friday</Name>
<Key>GOOD_FRIDAY</Key>
<Date>2007-04-06T00:00:00.0000000-07:00</Date>
<Type>Bank Holiday</Type>
</Holidays>
<!--
.
.
. -->
<Holidays diffgr:hasChanges="inserted" diffgr:id="Holidays34" msdata:rowOrder="33">
<Name>Hogmanay</Name>
<Key>HOGMANAY</Key>
<Date>2007-12-31T00:00:00.0000000-07:00</Date>
<Type>Notable Date</Type>
</Holidays>
</NewDataSet>
</diffgr:diffgram>
</GetHolidaysForYearResult>
</GetHolidaysForYearResponse>
</soap:Body>
</soap:Envelope>
Vielen Dank schon mal für eure Hilfe.
cu Richard