use of org.apache.camel.dataformat.soap.name.ElementNameStrategy in project camel by apache.
the class SoapClientTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
String jaxbPackage = GetCustomersByName.class.getPackage().getName();
@Override
public void configure() throws Exception {
ElementNameStrategy elNameStrat = new ServiceInterfaceStrategy(CustomerService.class, true);
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
final InputStream in = this.getClass().getResourceAsStream("response.xml");
from("direct:start").marshal(soapDataFormat).process(new FileReplyProcessor(in)).unmarshal(soapDataFormat);
}
};
}
use of org.apache.camel.dataformat.soap.name.ElementNameStrategy in project camel by apache.
the class SoapCxfClientTest method configure.
public void configure() throws Exception {
String jaxbPackage = GetCustomersByName.class.getPackage().getName();
ElementNameStrategy elNameStrat = new ServiceInterfaceStrategy(CustomerService.class, false);
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
getContext().setTracing(true);
//
from("direct:cxfclient").onException(Exception.class).handled(true).marshal(soapDataFormat).end().unmarshal(//
soapDataFormat).bean(//
serverBean).marshal(soapDataFormat);
}
use of org.apache.camel.dataformat.soap.name.ElementNameStrategy in project camel by apache.
the class SoapCxfServerTest method configure.
public void configure() throws Exception {
String jaxbPackage = GetCustomersByName.class.getPackage().getName();
ElementNameStrategy elNameStrat = new ServiceInterfaceStrategy(CustomerService.class, true);
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
//
from("direct:camelClient").marshal(//
soapDataFormat).to(//
"direct:cxfEndpoint").unmarshal(soapDataFormat);
}
use of org.apache.camel.dataformat.soap.name.ElementNameStrategy in project camel by apache.
the class SoapServerTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
String jaxbPackage = GetCustomersByName.class.getPackage().getName();
@Override
public void configure() throws Exception {
ElementNameStrategy elNameStrat = new TypeNameStrategy();
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat(jaxbPackage, elNameStrat);
CustomerServiceImpl serverBean = new CustomerServiceImpl();
//
from("direct:start").onException(Exception.class).handled(//
true).marshal(//
soapDataFormat).end().unmarshal(//
soapDataFormat).bean(//
serverBean).marshal(soapDataFormat);
}
};
}
use of org.apache.camel.dataformat.soap.name.ElementNameStrategy in project camel by apache.
the class Soap12MarshalTest method createDataFormat.
/**
* Create data format by using the constructor
*/
protected SoapJaxbDataFormat createDataFormat() {
String jaxbPackage = GetCustomersByName.class.getPackage().getName();
ElementNameStrategy elStrat = new TypeNameStrategy();
SoapJaxbDataFormat answer = new SoapJaxbDataFormat(jaxbPackage, elStrat);
answer.setVersion("1.2");
return answer;
}
Aggregations