You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ray Chen <ra...@gmail.com> on 2014/04/30 23:41:48 UTC
Problem when passing multiple parameters into the CXF endpoint
Hi All,
We are using the latest version of Camel 2.12.2, CXF 2.7.10, and Tomcat 7.
-- cxf interface
@WebService(name="createSecurityOrder", targetNamespace="http://www.com/")
@XmlSeeAlso({ObjectFactory.class})
public interface CreateSecurityOrder {
@WebResult(name = "Acknowledgment", targetNamespace = "http://www.com/")
@RequestWrapper(localName = "createSecurityOrder", targetNamespace
= "http://www.com/", className = "package.CreateSecurityOrder_Type")
@WebMethod
@ResponseWrapper(localName = "acknowledgment", targetNamespace =
"http://www.com/")
public Acknowledgment createSecurityOrder(
@WebParam(name = "miscellaneous", targetNamespace =
"http://www.com/")
PartnerInformation miscellaneous,
@WebParam(name = "paymentInformation", targetNamespace =
"http://www.com/")
PaymentInformation paymentInformation,
@WebParam(name = "customerInformation", targetNamespace =
"http://www.com/")
CustomerInformation customerInformation,
@WebParam(name = "securityBom", targetNamespace = "http://www.com/")
SecurityBOM securityBom,
@WebParam(mode = WebParam.Mode.INOUT, name =
"envelopeHeader", targetNamespace = "http://www.com/", header = true)
javax.xml.ws.Holder<EnvelopeHeader> envelopeHeader
) throws SecurityOrderException;
}
-- route configuration
from("cxf:bean:createSecurityOrder")
.routeId("preProcessOrder")
.log("before validateOrder, request = ${body}")
.wireTap("direct:tap")
.beanRef("validateOrder")
// wiretap pattern to queue
.log("after validateOrder, response = ${body}");
-- Implementation class
@Service("validateOrder")
public class CreateSecurityOrderImpl{
private static final Logger logger =
Logger.getLogger(CreateSecurityOrder.class);
public Acknowledgment createSecurityOrder(
PartnerInformation miscellaneous,
PaymentInformation paymentInformation,
CustomerInformation customerInformation,
SecurityBOM securityBom,
Holder<EnvelopeHeader> envelopeHeader) throws
SecurityOrderException {
---
When I made the soap request, the miscellaneous is fine, but
NullPointerException for rest parameters. I read some online
reference, the default data format is POJO, but could not figure it
out why it does not work.
Any discussions are welcome. Thanks a lot.
Ray