How to get DynamicField via Web Services (from .NET applications)

English! place to talk about development, programming and coding
Post Reply
Warlib
Znuny newbie
Posts: 20
Joined: 07 Jan 2015, 21:03
Znuny Version: 3.3.10
Real Name: Andrey
Company: Ridan

How to get DynamicField via Web Services (from .NET applications)

Post by Warlib »

I've met with strange realisation of web services to retrieve Dynamic Fields via SOAP. If we turn on DynamicFields when execute method TiсketGet, we will see SOAP response where DynamicFields with different names shows as properties, not as array.

Code: Select all

-<Ticket>
<Age>77479</Age>
<ArchiveFlag>n</ArchiveFlag>
+<Article>
<ChangeBy>1</ChangeBy>
<Changed>2015-03-21 01:15:06</Changed>
<CreateBy>1</CreateBy>
<CreateTimeUnix>1426889705</CreateTimeUnix>
<Created>2015-03-21 01:15:05</Created>
<CustomerID>mnp@beeline.ru</CustomerID>
<CustomerUserID>mnp@beeline.ru</CustomerUserID>
<DynamicField_Author/>
<DynamicField_CSStatus/>
<DynamicField_ClientMessage/>
<DynamicField_DateOfReceipt/>
It's huge problem for .NET developers, since to process such fields we must change WSDL file to generate proper References as soon as we add new DynamicField. It's nonsesnse. It's look like not a DynamicFields, but StaticFields.

It seems, that right way will be make some class DynamiсField with propertis: Name, ID, Value etc. and return in SOAP response array of such classes.

In WSDL file already exists description of such class:

Code: Select all

            <xsd:complexType name="OTRS_DynamicField">
                <xsd:sequence>
                    <xsd:element
                        name="Name"
                        type="xsd:string"
                        maxOccurs="1"
                        minOccurs="1">
                    </xsd:element>
                    <xsd:element
                        name="Value"
                        type="xsd:string" maxOccurs="unbounded">
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>

But this class used only in TicketCreate or TicketUpdate methods, but not for TicketGet. It's strange...
So, in current realization of DynamicaFields in WebServices it's close to impossible to use it. :-(
Post Reply