首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过SOAP在Polarion中创建工作项

通过SOAP在Polarion中创建工作项
EN

Stack Overflow用户
提问于 2021-07-20 12:03:55
回答 1查看 424关注 0票数 0

我试图通过Services在Polarion中创建工作项,但是我无法确定哪些内容是预期的。我正在使用TrackerWebService WSDL。

示例请求

代码语言:javascript
复制
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:trac="http://ws.polarion.com/TrackerWebService-impl"
    xmlns:trac1="http://ws.polarion.com/TrackerWebService-types"
    xmlns:proj="http://ws.polarion.com/ProjectWebService-types"
    xmlns:typ="http://ws.polarion.com/types">
    <soapenv:Header>
        <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
            soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session"
            >........sessionId.........</ns1:sessionID>
    </soapenv:Header>
    <soapenv:Body>
        <trac:createWorkItem>
            <trac:content>
                <trac1:description>
                        <typ:type>text/html</typ:type>
                        <typ:content>test</typ:content>
                        <typ:contentLossy>false</typ:contentLossy>
                </trac1:description>
                <trac1:project>
                    <proj:id>....projectId....</proj:id>
                </trac1:project>
                <trac1:type>
                    <trac1:id>testcase</trac1:id>
                </trac1:type>
            </trac:content>
        </trac:createWorkItem>
    </soapenv:Body>
</soapenv:Envelope>

响应

代码语言:javascript
复制
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server.userException</faultcode>
         <faultstring>java.lang.ClassCastException</faultstring>
         <detail>
            <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.lang.ClassCastException</ns1:stackTrace>
            <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">...server hostname....</ns2:hostname>
            <ns3:isRuntimeException xmlns:ns3="http://xml.apache.org/axis/">true</ns3:isRuntimeException>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

有几点我不确定:

我是否需要发送所有的omitted?

  • Even元素,即使它们是空的?
  • --我不知道什么是“不可解析的”属性,我也找不到关于它的描述--
  • --什么时候需要指定一个子程序,当我指定这样一个uri时,它就会抛出另一个错误,说URI不是normId
EN

回答 1

Stack Overflow用户

发布于 2021-07-20 14:24:06

最后在这方面取得了一些进展。来回答我自己的问题,也希望还有一些可怜的人也这么做:

  • 是否需要发送所有的xml元素,即使它们是空的?

不,只有必要的。不容易确定所需的配置,需要在polarion配置中进行检查,即使在那里,它也分布在不同的地方。

  • 我不知道什么是“无法解决的”属性,我也找不到它的描述

还是不知道这个,可能是‘可空’?

  • ,什么时候需要指定一个潜艇,什么时候可以省略?

当引用现有项时,需要指定子目录uri,下面是一个陷阱:其中的$符号必须用$转义。

即使我指定了这样一个uri,

  • 也会抛出另一个错误,即URI不是normId

这是对前一个问题的答案,美元需要逃脱。

下面是一个有用的例子:

代码语言:javascript
复制
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:trac="http://ws.polarion.com/TrackerWebService-impl"
    xmlns:trac1="http://ws.polarion.com/TrackerWebService-types"
    xmlns:proj="http://ws.polarion.com/ProjectWebService-types"
    xmlns:typ="http://ws.polarion.com/types">
    <soapenv:Header>
        <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
            soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session"
            >...session id ...</ns1:sessionID>
    </soapenv:Header>
    <soapenv:Body>
        <trac:createWorkItem>
            <trac:content unresolvable="false">
                <!--Optional:-->
                <trac1:author uri="subterra:data-service:objects:/default/&#36;{User}...username..."
                    unresolvable="false"/>

                <trac1:created>2021-07-20T09:18:29.905Z</trac1:created>

                <trac1:priority>
                    <trac1:id>medium</trac1:id>
                </trac1:priority>

                <trac1:project
                    uri="subterra:data-service:objects:/default/...projectid...&#36;{Project}...projectid..."
                    unresolvable="false"/>
              
                <trac1:severity>
                    <trac1:id>basic</trac1:id>
                </trac1:severity>
               
                <trac1:status>
                    <trac1:id>draft</trac1:id>
                </trac1:status>
                
       
                <trac1:title>Just another test</trac1:title>
                <trac1:type>
                    <trac1:id>testcase</trac1:id>
                </trac1:type>
               
                <trac1:updated>2021-07-20T09:18:29.993Z</trac1:updated>

            </trac:content>
        </trac:createWorkItem>
    </soapenv:Body>
</soapenv:Envelope>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68454575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档