Web Service Requests Failing

Moderator: crythias

Post Reply
BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Web Service Requests Failing

Post by BenI » 11 Jul 2019, 13:39

Good day,

We are running OTRS 5, on Debian 7 and busy testing web services to interface another system.

We have configured generic interface as per documentation provided, but when we do a test by running for example http://ticket.com/nph-genericinterface. ... sword=pass we get the following error:

Code: Select all

malformed header from script. Bad header=HTTP/1.1 411 Length Required: nph-genericinterface.pl
/nph-genericinterface.pl/Webservice/Test/Ticket/1234 did not send an HTTP header
What might be the issue?

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 30 Jul 2019, 09:16

What might be the issue in this regard?

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 11:27

Did a bit more research on this. And managed to get the an 200 OK from the web service.

However, I still do not know what info should be specified for header and trying to get a specific ticket via web service I get TicketGet.AuthFail error. This is the debug message:

Code: Select all

[Tue Aug 20 11:17:39 2019] [warn] /nph-genericinterface.pl/Webservice/TestWS did not send an HTTP header
ERROR: GenericInterfaceProvider-28 Perl: 5.14.2 OS: linux Time: Tue Aug 20 11:18:25 2019

 Message: DebugLog error:  Summary: TicketGet.AuthFail  Data   : TicketGet: Authorization failing!.

 RemoteAddress: 192.68.29.26
 RequestURI: /nph-genericinterface.pl/Webservice/TestWS

 Traceback (7531):
   Module: Kernel::GenericInterface::Debugger::DebugLog Line: 218
   Module: Kernel::GenericInterface::Debugger::Error Line: 312
   Module: Kernel::GenericInterface::Operation::Common::ReturnError Line: 123
   Module: Kernel::GenericInterface::Operation::Ticket::TicketGet::Run Line: 262
   Module: Kernel::GenericInterface::Operation::Run Line: 132
   Module: Kernel::GenericInterface::Provider::Run Line: 278
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_nph_2dgenericinterface_2epl::handler Line: 54
   Module: (eval) (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
   Module: ModPerl::Registry::handler (v1.99) Line: 31

[Tue Aug 20 11:18:25 2019] [error] [client 192.68.29.26] malformed header from script. Bad header=HTTP/1.1 200 OK: nph-genericinterface.pl
[Tue Aug 20 11:18:25 2019] [warn] /nph-genericinterface.pl/Webservice/TestWS did not send an HTTP header
As you can see, I get 200 OK for interface connection but TicketGet operation is not authenticating. What can be the issue in this case?

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 11:50

To resolve
TicketGet.AuthFail Data : TicketGet: Authorization failing!
I had to create a soap agent account that was added to

Code: Select all

Core::SOAP > SOAP::User & SOAP::Password under SysConfig
but still getting the header is malformed error message

Code: Select all

[Tue Aug 20 11:38:04 2019] [error] [client 192.68.29.26] malformed header from script. Bad header=HTTP/1.1 200 OK: nph-genericinterface.pl
[Tue Aug 20 11:38:04 2019] [warn] /nph-genericinterface.pl/Webservice/TestWS did not send an HTTP header
So I am now down to 1 issue. How must the header info be specified?

Anyone? :(

root
Moderator
Posts: 1851
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Web Service Requests Failing

Post by root » 20 Aug 2019, 12:10

Hi,
Core::SOAP > SOAP::User & SOAP::Password under SysConfig
are related to the outdated RPC interface (rpc.pl) AFAIK.

See https://github.com/OTRS/otrs/blob/rel-6 ... Request.pl for an example client for SOAP.

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 13:28

Alright. However it removed TicketGet.AuthFail error

root
Moderator
Posts: 1851
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Web Service Requests Failing

Post by root » 20 Aug 2019, 15:10

Hi,

Please show your SOAP request.

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 15:32

Here it is in xml form

Code: Select all

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tic="http://www.otrs.org/TicketConnector/">
   <soapenv:Header>0</soapenv:Header>
   <soapenv:Body>
      <tic:TicketGet>
         <!--You have a CHOICE of the next 3 items at this level-->
         <!--Optional:-->
         <UserLogin>username</UserLogin>
         <!--Optional:-->
         <CustomerUserLogin>?</CustomerUserLogin>
         <!--Optional:-->
         <SessionID>aeJsLvoiPcDHAPeekjgfjRHasrVKuAyh</SessionID>
         <!--Optional:-->
         <Password>P@$$w0rd</Password>
         <!--1 or more repetitions:-->
         <TicketID>41860</TicketID>
         <!--Optional:-->
         <DynamicFields>0</DynamicFields>
         <!--Optional:-->
         <Extended>?</Extended>
         <!--Optional:-->
         <AllArticles>0</AllArticles>
         <!--Optional:-->
         <ArticleSenderType>agent</ArticleSenderType>
         <!--Optional:-->
         <ArticleOrder>?</ArticleOrder>
         <!--Optional:-->
         <ArticleLimit>?</ArticleLimit>
         <!--Optional:-->
         <Attachments>?</Attachments>
      </tic:TicketGet>
   </soapenv:Body>
</soapenv:Envelope>

root
Moderator
Posts: 1851
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Web Service Requests Failing

Post by root » 20 Aug 2019, 16:04

Hi,

What are you using?

- UserLogin / Password
- CustomerUserLogin / Password
- SessionID

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 16:58

Roy,

I have removed the real username and password, but used the sessionID from live session in browser.

Or perhaps rephrase the question if I didn't answer it correctly.

root
Moderator
Posts: 1851
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Web Service Requests Failing

Post by root » 20 Aug 2019, 17:05

Hi,

I suggest your session is invalid and that's the reason for the auth problem. Use valid credentials.

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 17:24

I do not think its an authentication problem. If you look at the error message below, it seems to be that otrs/generic interface is not happy with header its receiving.

Code: Select all

[Tue Aug 20 11:38:04 2019] [error] [client 192.68.29.26] malformed header from script. Bad header=HTTP/1.1 200 OK: nph-genericinterface.pl
[Tue Aug 20 11:38:04 2019] [warn] /nph-genericinterface.pl/Webservice/TestWS did not send an HTTP header
This is the issue, how must the header be specified?

root
Moderator
Posts: 1851
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Web Service Requests Failing

Post by root » 20 Aug 2019, 18:46

BenI wrote:
20 Aug 2019, 17:24
I do not think its an authentication problem. If you look at the error message below, it seems to be that otrs/generic interface is not happy with header its receiving.

Code: Select all

[Tue Aug 20 11:38:04 2019] [error] [client 192.68.29.26] malformed header from script. Bad header=HTTP/1.1 200 OK: nph-genericinterface.pl
[Tue Aug 20 11:38:04 2019] [warn] /nph-genericinterface.pl/Webservice/TestWS did not send an HTTP header
This is the issue, how must the header be specified?
How do you send the request? Headers are always sent right before the body. The easiest way would be to show your client code. Is it a GET, POST, PUT or whatever request? How it's encoded? etc

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

BenI
OTRS expert
Posts: 72
Joined: 18 Mar 2014, 13:09
OTRS Version?: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Web Service Requests Failing

Post by BenI » 20 Aug 2019, 19:09

Roy,

I think there are 2 different headers, http & soap headers. Its soap header that might be giving the error.

The requests are being send from SoapUI app. And this is the HTML version of the request

Code: Select all

POST http://servername/nph-genericinterface.pl/Webservice/TestWS HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://www.otrs.org/TicketConnector/TicketGet"
Content-Length: 1173
Host: servername
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_181)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tic="http://www.otrs.org/TicketConnector/">
   <soapenv:Header>0</soapenv:Header>
   <soapenv:Body>
      <tic:TicketGet>
         <!--You have a CHOICE of the next 3 items at this level-->
         <!--Optional:-->
         <UserLogin>username</UserLogin>
         <!--Optional:-->
         <CustomerUserLogin>?</CustomerUserLogin>
         <!--Optional:-->
         <SessionID>aeJsLvoiPcDHAPeekjgfjRHasrVKuAyh</SessionID>
         <!--Optional:-->
         <Password>P@$$w0rd</Password>
         <!--1 or more repetitions:-->
         <TicketID>41860</TicketID>
         <!--Optional:-->
         <DynamicFields>0</DynamicFields>
         <!--Optional:-->
         <Extended>?</Extended>
         <!--Optional:-->
         <AllArticles>0</AllArticles>
         <!--Optional:-->
         <ArticleSenderType>agent</ArticleSenderType>
         <!--Optional:-->
         <ArticleOrder>?</ArticleOrder>
         <!--Optional:-->
         <ArticleLimit>?</ArticleLimit>
         <!--Optional:-->
         <Attachments>?</Attachments>
      </tic:TicketGet>
   </soapenv:Body>
</soapenv:Envelope>
So the issue here I think is the soap header. Do you have an idea of how that can be specified?

Post Reply