我收到错误“导入中没有 schemaLocation 属性”当使用Python客户端通过SOAP访问JIRA时

发布于 2024-12-04 22:41:47 字数 2952 浏览 0 评论 0原文

这是示例代码:

#!/usr/bin/env python

# Sample Python client accessing JIRA via SOAP. By default, accesses
# http://jira.atlassian.com with a public account. Methods requiring
# more than basic user-level access are commented out. Change the URL
# and project/issue details for local testing.
#
# Note: This Python client only works with JIRA 3.3.1 and above (see
# http://jira.atlassian.com/browse/JRA-7321)
#
# Refer to the SOAP Javadoc to see what calls are available:

import SOAPpy, getpass, datetime

soap = SOAPpy.WSDL.Proxy('http://jira.company.com:8080/rpc/soap/jirasoapservice-v2?wsdl')


jirauser='username'
passwd='password'

# This prints available methods, but the WSDL doesn't include argument
# names so its fairly useless. Refer to the Javadoc URL above instead
#print 'Available methods: ', soap.methods.keys()

def listSOAPmethods():
    for key in soap.methods.keys():
        print key, ': '
        for param in soap.methods[key].inparams:
            print '\t', param.name.ljust(10), param.type
        for param in soap.methods[key].outparams:
            print '\tOut: ', param.name.ljust(10), param.type


auth = soap.login(jirauser, passwd)

issue = soap.getIssue(auth, 'QA-79')
print "Retrieved issue:", issue

print "Done!"

完整的错误如下,以便提供完整的上下文:

IMPORT:  http://service.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://jira.mycompany.com:8080/rpc/soap/jirasoapservice-v2
no schemaLocation attribute in import
IMPORT:  http://exception.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
/usr/local/lib/python2.6/dist-packages/wstools-0.3-py2.6.egg/wstools/XMLSchema.py:3107: DeprecationWarning: object.__init__() takes no parameters
  tuple.__init__(self, args)
IMPORT:  http://service.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://beans.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://jira.mycompany.com:8080/rpc/soap/jirasoapservice-v2
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
IMPORT:  http://service.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://beans.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://exception.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
IMPORT:  http://beans.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://jira.mycompany.com:8080/rpc/soap/jirasoapservice-v2
no schemaLocation attribute in import
IMPORT:  http://exception.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import

here is the sample code :

#!/usr/bin/env python

# Sample Python client accessing JIRA via SOAP. By default, accesses
# http://jira.atlassian.com with a public account. Methods requiring
# more than basic user-level access are commented out. Change the URL
# and project/issue details for local testing.
#
# Note: This Python client only works with JIRA 3.3.1 and above (see
# http://jira.atlassian.com/browse/JRA-7321)
#
# Refer to the SOAP Javadoc to see what calls are available:

import SOAPpy, getpass, datetime

soap = SOAPpy.WSDL.Proxy('http://jira.company.com:8080/rpc/soap/jirasoapservice-v2?wsdl')


jirauser='username'
passwd='password'

# This prints available methods, but the WSDL doesn't include argument
# names so its fairly useless. Refer to the Javadoc URL above instead
#print 'Available methods: ', soap.methods.keys()

def listSOAPmethods():
    for key in soap.methods.keys():
        print key, ': '
        for param in soap.methods[key].inparams:
            print '\t', param.name.ljust(10), param.type
        for param in soap.methods[key].outparams:
            print '\tOut: ', param.name.ljust(10), param.type


auth = soap.login(jirauser, passwd)

issue = soap.getIssue(auth, 'QA-79')
print "Retrieved issue:", issue

print "Done!"

The complete error is as follows , in order to provide the complete context:

IMPORT:  http://service.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://jira.mycompany.com:8080/rpc/soap/jirasoapservice-v2
no schemaLocation attribute in import
IMPORT:  http://exception.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
/usr/local/lib/python2.6/dist-packages/wstools-0.3-py2.6.egg/wstools/XMLSchema.py:3107: DeprecationWarning: object.__init__() takes no parameters
  tuple.__init__(self, args)
IMPORT:  http://service.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://beans.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://jira.mycompany.com:8080/rpc/soap/jirasoapservice-v2
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
IMPORT:  http://service.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://beans.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://exception.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
IMPORT:  http://beans.soap.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://jira.mycompany.com:8080/rpc/soap/jirasoapservice-v2
no schemaLocation attribute in import
IMPORT:  http://exception.rpc.jira.atlassian.com
no schemaLocation attribute in import
IMPORT:  http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-12-11 22:41:47

我不久前将 JIRA Python CLI 代码更改为使用 suds 而不是 SOAPpy,并且没有回头。 SOAPpy 已经很老了,现在似乎不受支持。

I changed the JIRA Python CLI code to use suds instead of SOAPpy a while ago and haven't looked back. SOAPpy is pretty old and seems unsupported now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文