[python] volanie WSDL-webservice

RMiklos na pss.sk RMiklos na pss.sk
Pátek Listopad 9 16:06:28 CET 2007


Skusam zavolat z pythonu WSDL-webservice takto

1) import
>>> from SOAPpy import WSDL

2) specifikovat WSDL-file
>>> WSDLFile = "http://moj_server:6060/WSDL_subor"

3) vytvorit proxy
>>> proxy = WSDL.Proxy(WSDLFile)

4) zistit vsetky dostupne metody
>>> for method in proxy.methods.keys():
...     print "  %s" % method
...


To mi da vylistuje vsetky dostupne metody:
 
  getKlientInfo
  getKlientInfoRodneCislo
  ....
  ping
  getOsobaInfoRodneCislo
  .... 
  getZmluva
  getAktSaldovaciDatum
  ...

Potadeto mi vsetko funguje ok. Ked ale skusim zavolat najjednoduchsiu 
metodu bez parametra, napriklad tuto, ktora mi ma vratit datum

>>> aktsalddat=proxy.getAktSaldovaciDatum()

Dostanem more chyb:

<Fault e:Server: Unknown element getAktSaldovaciDatum: 
<SOAPpy.Types.structType detail at 25409136>: 
{'idoox-java-mapping.org.idoox.xmlrpc.MessageProcessingException': 
<SOAPpy.Types.structType 
idoox-java-mapping.org.idoox.xmlrpc.MessageProcessingException at 
25407576>: {'stack-trace': 'org.idoox.xmlrpc.MessageProcessingException: 
Unknown element getAktSaldovaciDatum\n\tat 
org.idoox.wasp.wsdl.SOAPMethodInfo$RequiredElements$Invocation.notNillElement(SOAPMethodInfo.java:1041)\n\tat 
com.systinet.wasp.server.adaptor.JavaInvoker.fillCallParamsXml(JavaInvoker.java:1250)\n\tat 
com.systinet.wasp.server.adaptor.JavaInvoker.beginInvoke(JavaInvoker.java:500)\n\tat 
com.idoox.wasp.server.adaptor.JavaAdaptorImpl.beginInvoke(JavaAdaptorImpl.java:63)\n\tat 
com.idoox.wasp.server.AdaptorTemplate.javaInvocation(AdaptorTemplate.java:511)\n\tat 
com.idoox.wasp.server.AdaptorTemplate.doDispatch(AdaptorTemplate.java:391)\n\tat 
com.idoox.wasp.server.AdaptorTemplate.dispatch(AdaptorTemplate.java:324)\n\tat 
com.idoox.wasp.server.ServiceConnector.dispatch(ServiceConnector.java:385)\n\tat 
com.systinet.wasp.ServiceManagerImpl.dispatchRequest(ServiceManagerImpl.java:639)\n\tat 
com.systinet.wasp.ServiceManagerImpl.dispatch(ServiceManagerImpl.java:476)\n\tat 
com.systinet.wasp.ServiceManagerImpl$DispatcherConnHandler.handlePost(ServiceManagerImpl.java:2585)\n\tat 
com.idoox.transport.http.server.Jetty$WaspHttpHandler.handle(Jetty.java:97)\n\tat 
com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:1087)\n\tat 
com.mortbay.HTTP.HttpServer.service(HttpServer.java:675)\n\tat 
com.mortbay.HTTP.HttpConnection.service(HttpConnection.java:457)\n\tat 
com.mortbay.HTTP.HttpConnection.handle(HttpConnection.java:317)\n\tat 
com.mortbay.HTTP.SocketListener.handleConnection(SocketListener.java:99)\n\tat 
com.mortbay.Util.ThreadedServer.handle(ThreadedServer.java:254)\n\tat 
com.mortbay.Util.ThreadPool$PoolThreadRunnable.run(ThreadPool.java:607)\n\tat 
java.lang.Thread.run(Thread.java:595)\n'}}>
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python24\Lib\site-packages\SOAPpy\Client.py", line 453, in 
__call__
    return self.__r_call(*args, **kw)
  File "C:\Python24\Lib\site-packages\SOAPpy\Client.py", line 475, in 
__r_call
    self.__hd, self.__ma)
  File "C:\Python24\Lib\site-packages\SOAPpy\Client.py", line 389, in 
__call
    raise p
faultType: <Fault e:Server: Unknown element getAktSaldovaciDatum: 
<SOAPpy.Types.structType detail at 25409136>: 
{'idoox-java-mapping.org.idoox.xmlrpc.MessageProcessingException': 
<SOAPpy.Types.structType 
idoox-java-mapping.org.idoox.xmlrpc.MessageProcessingException at 
25407576>: {'stack-trace': 'org.idoox.xmlrpc.MessageProcessingException: 
Unknown element getAktSaldovaciDatum\n\tat 
org.idoox.wasp.wsdl.SOAPMethodInfo$RequiredElements$Invocation.notNillElement(SOAPMethodInfo.java:1041)\n\tat 
com.systinet.wasp.server.adaptor.JavaInvoker.fillCallParamsXml(JavaInvoker.java:1250)\n\tat 
com.systinet.wasp.server.adaptor.JavaInvoker.beginInvoke(JavaInvoker.java:500)\n\tat 
com.idoox.wasp.server.adaptor.JavaAdaptorImpl.beginInvoke(JavaAdaptorImpl.java:63)\n\tat 
com.idoox.wasp.server.AdaptorTemplate.javaInvocation(AdaptorTemplate.java:511)\n\tat 
com.idoox.wasp.server.AdaptorTemplate.doDispatch(AdaptorTemplate.java:391)\n\tat 
com.idoox.wasp.server.AdaptorTemplate.dispatch(AdaptorTemplate.java:324)\n\tat 
com.idoox.wasp.server.ServiceConnector.dispatch(ServiceConnector.java:385)\n\tat 
com.systinet.wasp.ServiceManagerImpl.dispatchRequest(ServiceManagerImpl.java:639)\n\tat 
com.systinet.wasp.ServiceManagerImpl.dispatch(ServiceManagerImpl.java:476)\n\tat 
com.systinet.wasp.ServiceManagerImpl$DispatcherConnHandler.handlePost(ServiceManagerImpl.java:2585)\n\tat 
com.idoox.transport.http.server.Jetty$WaspHttpHandler.handle(Jetty.java:97)\n\tat 
com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:1087)\n\tat 
com.mortbay.HTTP.HttpServer.service(HttpServer.java:675)\n\tat 
com.mortbay.HTTP.HttpConnection.service(HttpConnection.java:457)\n\tat 
com.mortbay.HTTP.HttpConnection.handle(HttpConnection.java:317)\n\tat 
com.mortbay.HTTP.SocketListener.handleConnection(SocketListener.java:99)\n\tat 
com.mortbay.Util.ThreadedServer.handle(ThreadedServer.java:254)\n\tat 
com.mortbay.Util.ThreadPool$PoolThreadRunnable.run(ThreadPool.java:607)\n\tat 
java.lang.Thread.run(Thread.java:595)\n'}}>


V com moze byt problem?

Mgr. Ing. Roman MIKLÓŠ 
Prvá stavebná sporiteľňa a.s. 
Bajkalská 30, P. O. Box 48 
829 48  Bratislava 25 
Tel.: +421/ 2 / 582 31 174 
Fax: +421/ 2 / 582 31 109 
------------- další část ---------------
HTML příloha byla odstraněna...
URL: http://www.py.cz/pipermail/python/attachments/20071109/13f17b70/attachment.html 


Další informace o konferenci Python