Profil von veryVERY--我最喜欢的英文单词,极限的感觉! 红...FotosBlogListenMehr ![]() | Hilfe |
VERY--我最喜欢的英文单词,极限的感觉! 红色--我最喜欢的颜色,火焰燃烧般的热情! |
|||||
|
26 Juni 编译Python源文件,error: missing Python.h, limits.h stdio.h ...前两天装一个python软件库 (4suite),ubuntu 8操作系统,需要自己编译源文件,结果编译的时候总是报错,缺少一堆库文件,解决如下: operating system: ubuntu 8 python 2.5.2 --------------install error: missing Python.h---------------- command: sudo apt-get install python2.5-dev ---------------install error: missing limits.h stdio.h .…..------------------------------------------- install libc6-dev package for c headers command: sudo apt-get install libc6-dev 27 Mai use python zsi to create and publish a web service (rpc-encoded)I successfully published the web service in ubunbu 8 (remote) and vista64 (local) and invoked them for testing. python 2.5, zsi 2.1 (other zsi version may be different) step1. create helloDBfetch.wsdl, it is almost as same as hello wold. ------------------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8" standalone="no"?> ------------------------------------------------------------------------------- step2. run wsdl2py helloDBfetch.wsdl, generated 3 .py files (helloDBfetch_client.py, helloDBfetch_server.py, helloDBfetch_types.py), I put them under a folder called helloDBfetch, and also create a empty __init__.py in the folder to make it a package. step3. create service implementation code: helloDBimpl.py ------------------------------------------------------------------------- # make sure the path to helloDBfetch_server.py is correct, and import it from helloDBfetch.helloDBfetch_server import * from ZSI.ServiceContainer import AsServer # have to import this class myhelloDBfetchServices(helloDBfetch): step4. create server code: helloDBserver.py ---------------------------------------------------------------------------- from ZSI.ServiceContainer import AsServer -------------------------------------------------------------------------------- testing: local in vista64 run the helloDBserver.py you can open a browser check the wsdl file: http://localhost:8080/helloDBfetch?wsdl to invoke this web service, I use SoapUI (a free GUI service client, you can download it for free: http://www.soapui.org/), then just open the soapUI and create a new project, type in the project name and the URL of the wsdl file, it will generate a sample request for you, double click the sample request, in the popup window you will see the soap message, just replace the ? with any string you want, e.g. lalal, click the send arrow button, you will see the returned string is “hello lalal” inside the soap message. ***************************** testing: remote in ubuntu 8 upload all files in your ubuntu machine: helloDBfetch.wsdl, helloDBimpl.py, helloDBserver.py and the whole fold: helloDBfetch run helloDBserver.py in ubuntu 8 the URL of the wsdl is : http://yourUbuntuComputerIP:8080/helloDBfetch?wsdl still use SoapUI to invoke it, but the URL should changed to the new one, another thing is the generated wsdl file in the binding/location=…., it give the machine name, other than the real ip, in localhost, it does not matter, but remotely invoke the web service, you have to change the endpoint of the request in soapUI to the real ip of ubuntu machine other than the machine name, otherwise soapUi can not find your ubuntu machine. I do not know how to make it automatically use ip in the wsdl, so I have to manually change it when I use soapUI invoke it. +++++++++++++++++++++++++++++++++++ one wired thing I find is, in the helloDBimpl.py, the last line of code return response | this works in the ubuntu 8 return request, response | this works in vista64 otherwise it returns error: #return response, in vista, error: 'helloDbfetchResponse' object is not iterable 22 April 转:情诗执子之手,与子偕老 转: 某mm骂他男友,都不带脏字 (看了狂晕!)你这个: |
||||
|
|