This is my first time working with soap.
I managed to take my first steps following the tutorials, but now im stuck. Im trying to work with mantis (mantisbt.org). Im trying to post such data to the server:
<xsd:complexType name="IssueData">
<xsd:all>
<xsd:element name="id" type="xsd:integer" minOccurs="0"/>
<xsd:element name="view_state" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="last_updated" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="project" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="category" type="xsd:string" minOccurs="0"/>
<xsd:element name="priority" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="severity" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="status" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="reporter" type="tns:AccountData" minOccurs="0"/>
<xsd:element name="summary" type="xsd:string" minOccurs="0"/>
<xsd:element name="version" type="xsd:string" minOccurs="0"/>
<xsd:element name="build" type="xsd:string" minOccurs="0"/>
<xsd:element name="platform" type="xsd:string" minOccurs="0"/>
<xsd:element name="os" type="xsd:string" minOccurs="0"/>
<xsd:element name="os_build" type="xsd:string" minOccurs="0"/>
<xsd:element name="reproducibility" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="date_submitted" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="sponsorship_total" type="xsd:integer" minOccurs="0"/>
<xsd:element name="handler" type="tns:AccountData" minOccurs="0"/>
<xsd:element name="projection" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="eta" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="resolution" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="fixed_in_version" type="xsd:string" minOccurs="0"/>
<xsd:element name="target_version" type="xsd:string" minOccurs="0"/>
<xsd:element name="description" type="xsd:string" minOccurs="0"/>
<xsd:element name="steps_to_reproduce" type="xsd:string" minOccurs="0"/>
<xsd:element name="additional_information" type="xsd:string" minOccurs="0"/>
<xsd:element name="attachments" type="tns:AttachmentDataArray" minOccurs="0"/>
<xsd:element name="relationships" type="tns:RelationshipDataArray" minOccurs="0"/>
<xsd:element name="notes" type="tns:IssueNoteDataArray" minOccurs="0"/>
<xsd:element name="custom_fields" type="tns:CustomFieldValueForIssueDataArray" minOccurs="0"/>
<xsd:element name="due_date" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="monitors" type="tns:AccountDataArray" minOccurs="0"/>
<xsd:element name="sticky" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="tags" type="tns:ObjectRefArray" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
and it worked just fine. But then i found out i also need to fill some custom_fields. They are described as tns:CustomFieldValueForIssueDataArray.
<xsd:complexType name="CustomFieldValueForIssueDataArray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:CustomFieldValueForIssueData[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
I read from that that this should consist of CustomFieldValueForIssueData objects.
so i created two of those with relevant data:
contact_data = client.factory.create('CustomFieldValueForIssueData')
contact_data.field = contact_field
contact_data.value = 'alan@mysite.ee'
client_data = client.factory.create('CustomFieldValueForIssueData')
client_data.field = client_field
client_data.value = u'alan, alan kesselmann'
But how to add/append/push/whatever those values to array now? If i try to do something like this :
issue.custom_fields = [client_field, contact_field]
and then post it using:
client.service.mc_issue_add(user, pwd, issue)
Then all i get is an error. without custom_fields this ms_issue_add works.
Alan
Figured it out myself…
What i had to do was :
Alan