我正在尝试通过 SOAP Web 服务在 Polarion 中创建工作项,但是我无法确定需要哪些内容。我正在使用 TrackerWebService WSDL。
示例请求:
<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>
回应:
<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>
有几点我不确定:
- 我是否需要发送所有 xml 元素,即使它们是空的?
- 我不知道'Unresolvable'属性是什么,我也找不到它的描述
- 何时需要指定 subterra uri 之一,何时可以省略?
- 即使我指定了这样的 uri,它也会抛出另一个错误,说 URI 不是 normId