OTRS integration doesn't properly validate SOAP responses

Description

While debugging the new OTRS integration, after fixing HZN-513, I found out that OpenNMS failed to validate SOAP responses:

OpenNMS logs:

2015-11-04 16:14:52,019 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleMessage on interceptor org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor@f59abec
2015-11-04 16:14:52,023 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor@f59abec
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.jaxb.attachment.JAXBAttachmentSchemaValidationHack@38f43400
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor@2237075d
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor@283b6ecb
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor@6073c674
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor@2d32c46f
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor@5b5960cc
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.frontend.WSDLGetInterceptor@2e518316
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.interceptor.StaxInInterceptor@38b69f03
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.interceptor.AttachmentInInterceptor@47c3eb2f
2015-11-04 16:14:52,024 DEBUG [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Invoking handleFault on interceptor org.apache.cxf.ws.policy.PolicyInInterceptor@109d911f
2015-11-04 16:14:52,025 WARN [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Interceptor for
{http://www.otrs.org/TicketConnector/}

GenericTicketConnector#
{http://www.otrs.org/TicketConnector/}

TicketCreate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unexpected element
{http://www.otrs.org/TicketConnector}

TicketCreateResponse found. Expected TicketCreateResponse.

It is obviously not expecting the namespace in the SOAP response.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger December 14, 2015 at 5:26 PM

The PR for this was merged a few days ago:

https://github.com/OpenNMS/opennms/pull/491

Marking as fixed.

Ronny Trommer December 1, 2015 at 6:24 PM

I assume we move this to the next release right? Haven't found a comment which explains the why

Cyrille Bollu November 10, 2015 at 7:49 AM

WORKING!!!

cyr@opennms-dev:~/opennms$ git show
commit 574fde0c64502e6fcd99d10cbac23993dd6e249d
Author: Cyrille Bollu <cyrille.bollu2@gmail.com>
Date: Tue Nov 10 13:42:58 2015 +0100

: Updated OTRS' wsdl file so that all xml element are qualified (which is how OTRS replies).

diff --git a/features/ticketing/otrs-integration-31/src/main/resources/GenericTicketConnectorSOAP.wsdl b/features/ticketing/otrs-integration-31/src/main/resources/GenericTicketConnectorSOAP.wsdl
index a282208..79af283 100644
— a/features/ticketing/otrs-integration-31/src/main/resources/GenericTicketConnectorSOAP.wsdl
+++ b/features/ticketing/otrs-integration-31/src/main/resources/GenericTicketConnectorSOAP.wsdl
@@ -4,7 +4,7 @@ The Generic Ticket Connector web service for SOAP protocol

WARNING: This WSDL file is for Development and Test purposes ONLY!
</wsdl:documentation>

Seth Leger November 6, 2015 at 12:03 PM

Looks like more namespace issues which are always fun! One note: we're quickly approaching a code freeze for 17.0.0 development. After next Wednesday, we're going to stop merging changes into 17 so if you can get to a point where this code works before then, we can put it into 17.0.0 otherwise we'll have to delay merging the pull request until a 17.0.1 release. Thanks for the help Cyrille!

Cyrille Bollu November 6, 2015 at 11:44 AM

Ok, there are other mismatch deeper in the response:

2015-11-06 17:38:25,161 WARN [OpenNMS.TroubleTicketer-Thread] o.a.c.p.PhaseInterceptorChain: Interceptor for {http://www.otrs.org/TicketConnector/}GenericTicketConnector#{http://www.otrs.org/TicketConnector/}TicketCreate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"http://www.otrs.org/TicketConnector/", local:"ArticleID"). Expected elements are <{}TicketID>,<{}TicketNumber>,<{}Error>,<{}ArticleID>
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:905) ~[cxf-rt-databinding-jaxb-3.1.1.jar:3.1.1]
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:712) ~[cxf-rt-databinding-jaxb-3.1.1.jar:3.1.1]
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:176) ~[cxf-rt-databinding-jaxb-3.1.1.jar:3.1.1]
at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:194) ~[cxf-rt-wsdl-3.1.1.jar:3.1.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1641) [cxf-rt-transports-http-3.1.1.jar:3.1.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1532) [cxf-rt-transports-http-3.1.1.jar:3.1.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) [cxf-rt-transports-http-3.1.1.jar:3.1.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652) [cxf-rt-transports-http-3.1.1.jar:3.1.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277) [cxf-core-3.1.1.jar:3.1.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) [cxf-rt-frontend-simple-3.1.1.jar:3.1.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) [cxf-rt-frontend-jaxws-3.1.1.jar:3.1.1]
at com.sun.proxy.$Proxy147.ticketCreate(Unknown Source) [?:?]

But, that's definitively the way to go

Fixed

Details

Assignee

Reporter

Affects versions

Priority

PagerDuty

Created November 5, 2015 at 6:13 AM
Updated June 3, 2019 at 7:08 AM
Resolved December 14, 2015 at 5:26 PM