相关疑难解决方法(0)

使用Python和SOAPpy生成WSDL

首先,我承认我是Web服务的新手,虽然我熟悉HTML和基本Web内容.我使用Python创建了一个快速而肮脏的Web服务,该服务调用MySQL数据库中的存储过程,该服务只返回BIGINT值.我想在Web服务中返回此值,并且我想生成一个我可以为Web开发人员提供的WSDL.我可以补充一点,存储过程只返回一个值.

这是一些示例代码:

#!/usr/bin/python

import SOAPpy
import MySQLdb

def getNEXTVAL():
    cursor = db.cursor()
    cursor.execute( "CALL my_stored_procedure()" )  # Returns a number
    result=cursor.fetchall()

    for record in result:
        return record[0]

db=MySQLdb.connect(host="localhost", user="myuser", passwd="********", db="testing")
server = SOAPpy.SOAPServer(("10.1.22.29", 8080))
server.registerFunction(getNEXTVAL)
server.serve_forever()
Run Code Online (Sandbox Code Playgroud)

我想生成一个我可以给网络人员的WSDL,我想知道是否可以让SOAPpy为我生成一个.这可能吗?

python soap wsdl zsi soappy

13
推荐指数
1
解决办法
2万
查看次数

使用Python单击HTML页面上的某些链接时如何打开Windows文件夹

我正在编写以下程序:

***import os
filepath=r'C:\TestData\openfolder.html'
abc=open(filepath,'w')
abc.writelines('<html><head></head><body>')

abc.writelines('<a href="os.startfile(filepath)">First Link</a>\n')

abc.writelines('</body></html>')***
Run Code Online (Sandbox Code Playgroud)

我想要做的是如果我在浏览器上单击First Link,我应该能够打开路径为"Filepath"的文件夹.os.startfile非常适合打开文件夹,但我不知道如何在某个链接中实现它.谢谢.

html windows firefox internet-explorer google-chrome

4
推荐指数
1
解决办法
7万
查看次数

如何在Python中发送原始XML?

我试图将原始xml发送到Python中的服务.我有一个服务的地址,我的问题是如何在python中包装XML并将其发送到服务.地址格式如下.

192.1100.2.2:54239
Run Code Online (Sandbox Code Playgroud)

并说XML是:

<xml version="1.0" encoding="UTF-8"><header/><body><code><body/>
Run Code Online (Sandbox Code Playgroud)

谁知道该怎么办?

python xml

1
推荐指数
1
解决办法
4182
查看次数

标签 统计

python ×2

firefox ×1

google-chrome ×1

html ×1

internet-explorer ×1

soap ×1

soappy ×1

windows ×1

wsdl ×1

xml ×1

zsi ×1