Friday 15 August 2014

haskell - What is the XML for a valid OTRS-TicketSearch request -



haskell - What is the XML for a valid OTRS-TicketSearch request -

i seek interact otrs-ticketsystem in order create few pictures , calculate statistics. want in haskell - utilize bundle soap.

ignoring import statements code straightforward, create soap-transport config file soap.cfg (see below). build soap-body , phone call web service "dispatch".

{-# language overloadedstrings #-} import network (withsocketsdo) import network.soap import network.soap.transport.http import text.xml.writer import text.xml.stream.parse parse import data.text (text) import qualified data.text t import qualified data.bytestring.lazy.char8 bs import data.configurator (load, worth(required)) main :: io () main = withsocketsdo $ transport <- conftransport "soap" =<< load [required "./src/soap/soap.cfg"] allow body = element "ticketobject" ("ticketsearch" :: text) element "ownerid" ("owner" :: text) xmlresult <- invokews transport "#ticketobject" () body (rawparser id) bs.putstrln xmlresult

soap.cfg

soap { url = "http://domain/otrs/rpc.pl" user = "testuser" password = "testpass" trace = true timeout = 15 }

if build , phone call programme next xmlresult:

request:

<?xml version="1.0" encoding="utf-8"?> <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <ticketobject>ticketsearch</ticketobject> <ownerid>heu</ownerid> </soapenv:body> </soapenv:envelope>

response:

<?xml version="1.0" encoding="utf-8"?> <soap:envelope soap:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <soap:body> <soap:fault> <faultcode>soap:client</faultcode> <faultstring> soapaction shall match 'uri#method' if nowadays (got 'dispatch', expected '#ticketobject' </faultstring> </soap:fault> </soap:body> </soap:envelope>

if alter line next line

xmlresult <- invokews transport "dispatch" () body (rawparser id)

to

xmlresult <- invokews transport "#ticketobject" () body (rawparser id)

the faultstring becomes

<faultstring> denied access method (ticketobject) in class (main) @ /opt/otrs/kernel/cpan-lib/soap/lite.pm line 2810. </faultstring>

i searched net solution, found this

http://otrs.perl-services.de/… ticketsearch, , of course of study otrs 3.3 api http://blog.otrs.org -> ticket search (perl) otrs client in java otrs iphoneobject providing json

with lastly 1 managed result - iphoneobject , ticketget - unfortunately ticketsearch seems not supported.

can tell me valid xml request needs like?

i found how create otrs ticket using soap request .net - uses web services - unfortunately not know how create such service.

xml haskell soap otrs

No comments:

Post a Comment