Vaibhav Bhootna
Vaibhav Bhootna

Reputation: 176

Empty Soap Body returned from Camel Processor in Payload Mode

I am creating cxf webservice First the cxf endpoint will get a call then it pass to a camel route in payload mode and in camel route first I unmarhall the request and do some processing after this it retuns a response

But When I am returning a response I am getting empty body. While all the data is correctly showing on the log.

Do I require a Processor to change it into soap message.

<from uri="cxf:bean:cardServiceCall?dataFormat=PAYLOAD" />
<camel:unmarshal ref="jaxb" />
<camel:process ref="ResponseProcessor"></camel:process>
<camel:marshal ref="jaxb" />

Upadte I came to know that I have to marshall it, But on marshalling I am getting JAXB marshalling error XMLRootElement annontation missing error

Upvotes: 1

Views: 1000

Answers (1)

Vaibhav Bhootna
Vaibhav Bhootna

Reputation: 176

I solved this problem, Actuallly there is a problem in my schema.

I have given name to my complex type and refered element type with that name which incorrect. You should do this like below

 <xsd:element name="myRequest">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="cardNumber" type="xsd:long" />
            <xsd:element name="transactionNumber" type="xsd:long" />
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

Upvotes: 1

Related Questions