camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Shaw <Matthew.S...@ambulance.qld.gov.au>
Subject RE: CxfEndpoint and wsdl message part issue
Date Thu, 27 Jul 2017 21:20:22 GMT
Hi Zoran,

Thanks I have tried with embedded xsd but no luck unfortunately. I've changed the data format
from POJO to PAYLOAD and it seems to be working, but now I have to do the serialization /
deserialization myself. Not ideal I guess as the POJO option looked really good. I still don't
understand why it wasn't working. However I did notice that my generated pojos didn't have
the @XmlRootElement annotation on them for jaxb, so I wonder if this was the actual problem.
I'll try it with again and see. 

Cheers,
Matt.

-----Original Message-----
From: Zoran Regvart [mailto:zoran@regvart.com] 
Sent: Thursday, 27 July 2017 6:52 PM
To: users@camel.apache.org
Subject: Re: CxfEndpoint and wsdl message part issue

Hi Matthew,
on first sight that import in WSDL looks fishy to me, perhaps you can try embedding the XSD
in the WSDL? I'm sure you have seen it but if you haven't there is an example with Camel and
CXF in OSGI[1] that you can try to play with,

zoran

[1] https://github.com/apache/camel/tree/master/examples/camel-example-cxf-osgi

On Thu, Jul 27, 2017 at 3:14 AM, Matthew Shaw <Matthew.Shaw@ambulance.qld.gov.au> wrote:
> Hi,
>
> I'm configuring a camel route with a cxf web service endpoint and deploying into osgi/karaf
via declarative services. Service starts up ok and I can browse the wsdl. However invoking
from soapui with a valid request I am getting the following error:
>
> org.apache.cxf.interceptor.Fault: Message part 
> {http://services.ambulance.qld.gov.au/data/messaging/legacywrapper/eti
> mesheet}eTimesheetRequest was not recognized.  (Does it exist in 
> service WSDL?)
>
> I definitely does exist in the schema imported by the wsdl. See the wsdl and appropriate
xsd definitions below. Also, here is my route setup. I'm generating SEI and other classes
using the cxf codegen plugin with maven.
>
> CxfEndpoint endpoint = new CxfEndpoint(); 
> endpoint.setCamelContext(getContext());
> endpoint.setWsdlURL("wsdl/eTimesheetWrapper.wsdl");
> endpoint.setAddress("http://localhost:8182/services/legacywrapper/etim
> esheet"); endpoint.setDataFormat(DataFormat.POJO);
> endpoint.setServiceClass( 
> au.gov.qld.ambulance.services.legacywrapper.etimesheet.ETimesheetWrapp
> erService.class); QName serviceName = new 
> QName("http://services.ambulance.qld.gov.au/legacywrapper/etimesheet", 
> "eTimesheetWrapperService"); QName portName = new 
> QName("http://services.ambulance.qld.gov.au/legacywrapper/etimesheet", 
> "eTimesheetWrapper"); endpoint.setPortName(portName);
>
> from(endpoint)
>         .log("I received your soap message.")
>         .inputType(ETimesheetRequest.class)
>         .to("direct:extractTimesheetId");
>
>
> WSDL
>
> This XML file does not appear to have any style information associated with it. The document
tree is shown below.
> <wsdl:definitions xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> xmlns:tns="http://services.ambulance.qld.gov.au/legacywrapper/etimeshe
> et"xmlns:ta="http://services.ambulance.qld.gov.au/data/services/corpor
> ate/hri/timeandattendance" 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"xmlns:et="http://ser
> vices.ambulance.qld.gov.au/data/messaging/legacywrapper/etimesheet" 
> name="eTimesheetWrapper" 
> targetNamespace="http://services.ambulance.qld.gov.au/legacywrapper/et
> imesheet"> <wsdl:import 
> location="http://localhost:8182/services/legacywrapper/etimesheet?wsdl
> =../xsd/eTimesheetWrapper.xsd" 
> namespace="http://services.ambulance.qld.gov.au/data/messaging/legacyw
> rapper/etimesheet"></wsdl:import>
> <wsdl:types></wsdl:types>
> <wsdl:message name="getPayPeriodRequest"> <wsdl:part 
> element="et:eTimesheetRequest" name="request"></wsdl:part> 
> </wsdl:message> <wsdl:message 
> name="getTimesheetsByStatusAndPayPeriodResponse">
> <wsdl:part element="et:eTimesheetResponse" name="return"></wsdl:part> 
> </wsdl:message> <wsdl:message name="getTimesheetResponse"> <wsdl:part

> element="et:eTimesheetResponse" name="return"></wsdl:part> 
> </wsdl:message> <wsdl:message 
> name="getApprovedTimesheetsForPayPeriodResponse">
> <wsdl:part element="et:eTimesheetResponse" name="return"></wsdl:part> 
> </wsdl:message> <wsdl:message name="getCurrentPayPeriodResponse">
> <wsdl:part element="et:eTimesheetResponse" name="return"></wsdl:part> 
> </wsdl:message> <wsdl:message 
> name="getTimesheetsByStatusAndPayPeriodRequest">
> <wsdl:part element="et:eTimesheetStatusPayPeriodRequest" 
> name="request"></wsdl:part> </wsdl:message> <wsdl:message 
> name="getTimesheetRequest"> <wsdl:part element="et:eTimesheetRequest" 
> name="request"></wsdl:part> </wsdl:message> <wsdl:message 
> name="getApprovedTimesheetsForPayPeriodRequest"></wsdl:message>
> <wsdl:message name="getCurrentPayPeriodRequest">
> <wsdl:part element="et:eTimesheetRequest" name="request"></wsdl:part> 
> </wsdl:message> <wsdl:message name="getPayPeriodResponse"> <wsdl:part

> element="et:eTimesheetResponse" name="return"></wsdl:part> 
> </wsdl:message> <wsdl:portType name="eTimesheetWrapperPort"> 
> <wsdl:documentation>Exposes the eTimesheet session 
> EJBs</wsdl:documentation> <wsdl:operation 
> name="getApprovedTimesheetsForPayPeriod">
> <wsdl:input message="tns:getApprovedTimesheetsForPayPeriodRequest" 
> name="getApprovedTimesheetsForPayPeriodRequestRequest"></wsdl:input>
> <wsdl:output message="tns:getApprovedTimesheetsForPayPeriodResponse" 
> name="getApprovedTimesheetsForPayPeriodRequestResponse"></wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getTimesheet">
> <wsdl:input message="tns:getTimesheetRequest" 
> name="getTimesheetRequestRequest"></wsdl:input>
> <wsdl:output message="tns:getTimesheetResponse" 
> name="getTimesheetRequestResponse"></wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getTimesheetsByStatusAndPayPeriod">
> <wsdl:input message="tns:getTimesheetsByStatusAndPayPeriodRequest" 
> name="getTimesheetsByStatusAndPayPeriodRequestRequest"></wsdl:input>
> <wsdl:output message="tns:getTimesheetsByStatusAndPayPeriodResponse" 
> name="getTimesheetsByStatusAndPayPeriodRequestResponse"></wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getCurrentPayPeriod"> <wsdl:input 
> message="tns:getCurrentPayPeriodRequest" 
> name="getCurrentPayPeriodRequestRequest"></wsdl:input>
> <wsdl:output message="tns:getCurrentPayPeriodResponse" 
> name="getCurrentPayPeriodRequestResponse"></wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getPayPeriod">
> <wsdl:input message="tns:getPayPeriodRequest" 
> name="getPayPeriodRequestRequest"></wsdl:input>
> <wsdl:output message="tns:getPayPeriodResponse" 
> name="getPayPeriodRequestResponse"></wsdl:output>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="eTimesheetWrapperBinding" 
> type="tns:eTimesheetWrapperPort"> <wsdl:documentation>Exposes the 
> eTimesheet session EJBs</wsdl:documentation> <soap:binding 
> style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="getApprovedTimesheetsForPayPeriod">
> <soap:operation soapAction="getApprovedTimesheetsForPayPeriod" 
> style="document"/> <wsdl:input 
> name="getApprovedTimesheetsForPayPeriodRequestRequest">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getApprovedTimesheetsForPayPeriodRequestResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getTimesheet">
> <soap:operation soapAction="getTimesheet" style="document"/> 
> <wsdl:input name="getTimesheetRequestRequest">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getTimesheetRequestResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getTimesheetsByStatusAndPayPeriod">
> <soap:operation soapAction="getTimesheetsByStatusAndPayPeriod" 
> style="document"/> <wsdl:input 
> name="getTimesheetsByStatusAndPayPeriodRequestRequest">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getTimesheetsByStatusAndPayPeriodRequestResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getCurrentPayPeriod"> <soap:operation 
> soapAction="getCurrentPayPeriod" style="document"/> <wsdl:input 
> name="getCurrentPayPeriodRequestRequest">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getCurrentPayPeriodRequestResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getPayPeriod">
> <soap:operation soapAction="getPayPeriod" style="document"/> 
> <wsdl:input name="getPayPeriodRequestRequest">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getPayPeriodRequestResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="eTimesheetWrapperService"> <wsdl:port 
> binding="tns:eTimesheetWrapperBinding" name="eTimesheetWrapper"> 
> <soap:address 
> location="http://localhost:8182/services/legacywrapper/etimesheet"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> Relevant XSD
>
> This XML file does not appear to have any style information associated with it. The document
tree is shown below.
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> <wsdl:types>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns:ta="http://services.ambulance.qld.gov.au/data/services/corporate
> /hri/timeandattendance" 
> xmlns:eTimesheetWrapper="http://services.ambulance.qld.gov.au/data/mes
> saging/legacywrapper/etimesheet"xmlns:cmm="http://services.ambulance.q
> ld.gov.au/data/messaging/common" 
> xmlns="http://services.ambulance.qld.gov.au/data/messaging/legacywrapp
> er/etimesheet" 
> targetNamespace="http://services.ambulance.qld.gov.au/data/messaging/l
> egacywrapper/etimesheet"> <xs:import 
> namespace="http://services.ambulance.qld.gov.au/data/services/corporat
> e/hri/timeandattendance" 
> schemaLocation="http://localhost:8182/services/legacywrapper/etimeshee
> t?xsd=../xsd/TimeAndAttendance.xsd"/>
> <xs:import 
> namespace="http://services.ambulance.qld.gov.au/data/messaging/common" 
> schemaLocation="http://localhost:8182/services/legacywrapper/etimeshee
> t?xsd=../xsd/Common.xsd"/> <xs:complexType name="PayPeriodPayload"> 
> <xs:complexContent> <xs:extension base="cmm:BusinessPayload"> 
> <xs:sequence> <xs:element maxOccurs="1" minOccurs="0" 
> name="payPeriodId" type="xs:int"/> <xs:element maxOccurs="1" 
> minOccurs="0" name="payPeriodDate" type="xs:string"/> </xs:sequence> 
> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType

> name="eTimesheetRequest"> <xs:complexContent> <xs:extension 
> base="cmm:QASMessage"> <xs:sequence> <xs:element maxOccurs="1" 
> minOccurs="1" name="timesheetId" type="xs:int"/> </xs:sequence> 
> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType

> name="eTimesheetResponse"> <xs:complexContent> <xs:extension 
> base="cmm:QASMessage"> <xs:sequence/> </xs:extension> 
> </xs:complexContent> </xs:complexType> <xs:complexType 
> name="eTimesheetStatusPayPeriodRequest">
> <xs:complexContent>
> <xs:extension base="cmm:QASMessage">
> <xs:sequence>
> <xs:element maxOccurs="1" minOccurs="0" name="status" 
> type="xs:string"/> <xs:element maxOccurs="1" minOccurs="0" 
> name="payPeriod" type="xs:int"/> <xs:element maxOccurs="1" 
> minOccurs="0" name="payPeriodDate" type="xs:string"/> </xs:sequence> 
> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType

> name="TimesheetPayload"> <xs:complexContent> <xs:extension 
> base="cmm:BusinessPayload"> <xs:sequence> <xs:element 
> maxOccurs="unbounded" minOccurs="0" ref="ta:Timesheet"/> 
> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>

> <xs:element name="eTimesheetRequest" 
> type="eTimesheetWrapper:eTimesheetRequest"/>
> <xs:element name="eTimesheetResponse" 
> type="eTimesheetWrapper:eTimesheetResponse"/>
> <xs:element name="eTimesheetStatusPayPeriodRequest" 
> type="eTimesheetWrapper:eTimesheetStatusPayPeriodRequest"/>
> <xs:element name="TimesheetPayload" 
> type="eTimesheetWrapper:TimesheetPayload"/>
> </xs:schema>
> </wsdl:types>
> </wsdl:definitions>
>
>
> I've seen on a previous user thread here: http://camel.465427.n5.nabble.com/Operations-are-unavailable-when-defining-for-a-CXF-endpoint-td2644645.html
that someone was having the same issue and could get the same config to work outside and osgi
container, ie. Servlet container.
>
> I need this to work in osgi. I've tried placing the xsd directly in the types declaration
of the wsdl, but no fix. Any ideas?
>
>
>
> This email, including any attachments sent with it, is confidential and for the sole
use of the intended recipient(s). This confidentiality is not waived or lost, if you receive
it and you are not the intended recipient(s), or if it is transmitted/received in error.
>
> Any unauthorised use, alteration, disclosure, distribution or review of this email is
strictly prohibited. The information contained in this email, including any attachment sent
with it, may be subject to a statutory duty of confidentiality if it relates to health service
matters.
>
> If you are not the intended recipient(s), or if you have received this email in error,
you are asked to immediately notify the sender. You should also delete this email, and any
copies, from your computer system network and destroy any hard copies produced.
>
> If not an intended recipient of this email, you must not copy, distribute or take any
action(s) that relies on it; any form of disclosure, modification, distribution and/or publication
of this email is also prohibited.
>
> Although the Queensland Ambulance Service takes all reasonable steps to ensure this email
does not contain malicious software, the Queensland Ambulance Service does not accept responsibility
for the consequences if any person's computer inadvertently suffers any disruption to services,
loss of information, harm or is infected with a virus, other malicious computer programme
or code that may occur as a consequence of receiving this email.
>
> Unless stated otherwise, this email represents only the views of the sender and not the
views of the Queensland Government.
>
> **********************************************************************
> **********
>
> The content presented in this publication is distributed by the Queensland Government
as an information source only. The State of Queensland makes no statements, representations
or warranties about the accuracy, completeness or reliability of any information contained
in this publication. The State of Queensland disclaims all responsibility and all liability
(including without limitation for liability in negligence) for all expenses, losses, damages
and costs you might incur as a result of the information being inaccurate or incomplete in
any way, and for any reason reliance was placed on such information.



--
Zoran Regvart

This email, including any attachments sent with it, is confidential and for the sole use of
the intended recipient(s). This confidentiality is not waived or lost, if you receive it and
you are not the intended recipient(s), or if it is transmitted/received in error.

Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly
prohibited. The information contained in this email, including any attachment sent with it,
may be subject to a statutory duty of confidentiality if it relates to health service matters.

If you are not the intended recipient(s), or if you have received this email in error, you
are asked to immediately notify the sender. You should also delete this email, and any copies,
from your computer system network and destroy any hard copies produced.

If not an intended recipient of this email, you must not copy, distribute or take any action(s)
that relies on it; any form of disclosure, modification, distribution and/or publication of
this email is also prohibited.

Although the Queensland Ambulance Service takes all reasonable steps to ensure this email
does not contain malicious software, the Queensland Ambulance Service does not accept responsibility
for the consequences if any person's computer inadvertently suffers any disruption to services,
loss of information, harm or is infected with a virus, other malicious computer programme
or code that may occur as a consequence of receiving this email.

Unless stated otherwise, this email represents only the views of the sender and not the views
of the Queensland Government.

********************************************************************************

The content presented in this publication is distributed by the Queensland Government as an
information source only. The State of Queensland makes no statements, representations or warranties
about the accuracy, completeness or reliability of any information contained in this publication.
The State of Queensland disclaims all responsibility and all liability (including without
limitation for liability in negligence) for all expenses, losses, damages and costs you might
incur as a result of the information being inaccurate or incomplete in any way, and for any
reason reliance was placed on such information.
Mime
View raw message