я получаю сообщение об ошибке «Нет атрибута schemaLocation в импорте» при использовании клиента Python, обращающегося к JIRA через SOAP - PullRequest
1 голос
/ 15 сентября 2011

Вот пример кода:

#!/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

1 Ответ

0 голосов
/ 16 сентября 2011

Я изменил код CLI JIRA Python для использования suds вместо SOAPpy некоторое время назад и не оглядывался назад. SOAPpy довольно старый и кажется неподдерживаемым.

...