1

I'm trying to create work items in Polarion via the SOAP Web Services, however i can't figure out which content is expected. I'm using the TrackerWebService WSDL.

Example Request:

<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>

Response:

<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>

There are a few points I'm unsure about:

  • Do i need to send all xml elements, even if they're empty?
  • I don't know what the 'Unresolvable' attribute is, i also can't find a description of it
  • When does one of the subterra uri's need to be specified and when can it be omitted?
  • Even when i specify such a uri, it will then throw another error, saying that the URI isn't a normId

1 Answers1

1

Finally made some progress on this. To answer my own questions and hopefully also of some poor sod who tries to do the same:

  • Do i need to send all xml elements, even if they're empty?
    No, only the ones required. The ones which are required is not easily determined, that needs to be checked in the polarion configuration and even there it's distributed across different places.

  • I don't know what the 'Unresolvable' attribute is, i also can't find a description of it
    Still don't know this one, possible 'nullable'?

  • When does one of the subterra uri's need to be specified and when can it be omitted?
    When referencing existing items, the subterra uri needs to be specified and here is the catch: The $ sign in it must be escaped with &#36

  • Even when i specify such a uri, it will then throw another error, saying that the URI isn't a normId
    This is the answer to the previous question, the dollar needed to be escaped.

Here's a working example:

<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>