[SOLVED] OTRS WebService TicketGet

Post Reply
MaxMaz
OTRS newbie
Posts: 30
Joined: 08 Sep 2015, 17:06
OTRS Version?: 3.3.9

[SOLVED] OTRS WebService TicketGet

Post by MaxMaz » 08 Sep 2015, 17:23

Ciao a tutti volevo vedere come funziona il webservice TicketGet
L'applicazione in c# che invoca TicketGet non restituisce nessun errore e il debugger del webservice sul pannello di amministrazione è ok.
Il mio problema è che non riesco a visualizzare il result, è vuoto;

Questo è il codice c#

Code: Select all

 
OTRSClient.OTRSServiceReference.GenericTicketConnector_PortTypeClient client = new OTRSClient.OTRSServiceReference.GenericTicketConnector_PortTypeClient();

            OTRSClient.OTRSServiceReference.TicketGet ticketparams = new OTRSClient.OTRSServiceReference.TicketGet();
            ticketparams.Item = "some_user";
            ticketparams.Password = "some_pass";
            ticketparams.ItemElementName = OTRSClient.OTRSServiceReference.ItemChoiceType5.UserLogin;
            ticketparams.TicketID = new string[] { "1" };

            OTRSClient.OTRSServiceReference.OTRS_TicketGetResponse_Ticket[] result = client.TicketGet(ticketparams);
         
End point nell'app.config

Code: Select all

    
    <client>
      <endpoint address="http://server/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorSOAP"
          binding="customBinding" bindingConfiguration="GenericTicketConnector_Service"
          contract="OTRSClient.OTRSServiceReference.GenericTicketConnector_PortType"
          name="GenericTicketConnector_Port" />
    </client>
    
Custom Binding

Code: Select all

     
     <customBinding>
        <binding name="GenericTicketConnector_Service">
          <textMessageEncoding messageVersion="Soap12" writeEncoding="utf-8" />
          <httpTransport authenticationScheme="Ntlm" proxyAuthenticationScheme="Ntlm" decompressionEnabled="false" realm=""/>
        </binding>
      </customBinding>
      
Outgoing data after mapping (2015-09-08 16:47:42, debug)

Code: Select all

$VAR1 = {
  'Ticket' => [
    {
      'Age' => 160973262,
      'ArchiveFlag' => 'n',
      'ChangeBy' => 1,
      'Changed' => '2014-10-21 14:24:26',
      'CreateBy' => 1,
      'CreateTimeUnix' => '1280750400',
      'Created' => '2010-08-02 14:00:00',
      'CustomerID' => undef,
      'CustomerUserID' => undef,
      'EscalationResponseTime' => 0,
      'EscalationSolutionTime' => 0,
      'EscalationTime' => 0,
      'EscalationUpdateTime' => 0,
      'GroupID' => 1,
      'Lock' => 'unlock',
      'LockID' => 1,
      'Owner' => 'root@localhost',
      'OwnerID' => 1,
      'Priority' => '3 normal',
      'PriorityID' => 3,
      'Queue' => 'Non Classificati',
      'QueueID' => 2,
      'RealTillTimeNotUsed' => 0,
      'Responsible' => 'root@localhost',
      'ResponsibleID' => 1,
      'SLAID' => '',
      'ServiceID' => '',
      'State' => 'new',
      'StateID' => 1,
      'StateType' => 'new',
      'TicketID' => 1,
      'TicketNumber' => '2010080210123456',
      'Title' => 'Welcome to OTRS!',
      'Type' => 'Unclassified',
      'TypeID' => 1,
      'UnlockTimeout' => 0,
      'UntilTime' => 0
    }
  ]
};


Non capisco proprio, spero in un aiuto
Last edited by MaxMaz on 11 Sep 2015, 11:35, edited 1 time in total.

MaxMaz
OTRS newbie
Posts: 30
Joined: 08 Sep 2015, 17:06
OTRS Version?: 3.3.9

Re: OTRS WebService TicketGet

Post by MaxMaz » 10 Sep 2015, 13:25

RISOLTO!!!!!
il wsdl fornito da GitHub è incompleto. La classe proxy creata con l'utility svcutil.exe ha bisogno di questa modifica:
tutti i Namespace = "" devono diventare Namespace = "http://www.otrs.org/TicketConnector/"

Spero aiuti

Post Reply