use of org.apache.camel.dataformat.soap.name.TypeNameStrategy 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.TypeNameStrategy in project camel by apache.
the class SoapToSoapDontIgnoreTest method setup.
@BeforeClass
public static void setup() {
namespacePrefixMap = new HashMap<String, String>();
namespacePrefixMap.put("http://schemas.xmlsoap.org/soap/envelope/", "soap");
namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema", "xsd");
namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
namespacePrefixMap.put("http://www.example.com/contact", "cont");
namespacePrefixMap.put("http://www.example.com/soapheaders", "custom");
soapjaxbModel = new SoapJaxbDataFormat("com.example.contact:com.example.soapheaders");
soapjaxbModel.setNamespacePrefix(namespacePrefixMap);
soapjaxbModel.setPrettyPrint(true);
soapjaxbModel.setIgnoreUnmarshalledHeaders(false);
soapjaxbModel.setIgnoreJAXBElement(false);
soapjaxbModel.setElementNameStrategy(new TypeNameStrategy());
soapjaxbModelDontIgnoreUnmarshalled = new SoapJaxbDataFormat("com.example.contact:com.example.soapheaders");
soapjaxbModelDontIgnoreUnmarshalled.setNamespacePrefix(namespacePrefixMap);
soapjaxbModelDontIgnoreUnmarshalled.setPrettyPrint(true);
soapjaxbModelDontIgnoreUnmarshalled.setIgnoreUnmarshalledHeaders(false);
soapjaxbModelDontIgnoreUnmarshalled.setElementNameStrategy(new TypeNameStrategy());
}
use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.
the class SoapToSoapIgnoreTest method setup.
@BeforeClass
public static void setup() {
namespacePrefixMap = new HashMap<String, String>();
namespacePrefixMap.put("http://schemas.xmlsoap.org/soap/envelope/", "soap");
namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema", "xsd");
namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
namespacePrefixMap.put("http://www.example.com/contact", "cont");
namespacePrefixMap.put("http://www.example.com/soapheaders", "custom");
soapjaxbModel = new SoapJaxbDataFormat("com.example.contact:com.example.soapheaders");
soapjaxbModel.setNamespacePrefix(namespacePrefixMap);
soapjaxbModel.setPrettyPrint(true);
soapjaxbModel.setIgnoreUnmarshalledHeaders(false);
soapjaxbModel.setIgnoreJAXBElement(false);
soapjaxbModel.setElementNameStrategy(new TypeNameStrategy());
soapjaxbModelIgnoreUnmarshalled = new SoapJaxbDataFormat("com.example.contact:com.example.soapheaders");
soapjaxbModelIgnoreUnmarshalled.setNamespacePrefix(namespacePrefixMap);
soapjaxbModelIgnoreUnmarshalled.setPrettyPrint(true);
soapjaxbModelIgnoreUnmarshalled.setIgnoreUnmarshalledHeaders(true);
soapjaxbModelIgnoreUnmarshalled.setElementNameStrategy(new TypeNameStrategy());
}
use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.
the class SoapToSoapSingleDataFormatterTest method setup.
@BeforeClass
public static void setup() {
namespacePrefixMap = new HashMap<String, String>();
namespacePrefixMap.put("http://schemas.xmlsoap.org/soap/envelope/", "soap");
namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema", "xsd");
namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
namespacePrefixMap.put("http://www.example.com/contact", "cont");
namespacePrefixMap.put("http://www.example.com/soapheaders", "custom");
soapjaxbModel = new SoapJaxbDataFormat("com.example.contact:com.example.soapheaders");
soapjaxbModel.setNamespacePrefix(namespacePrefixMap);
soapjaxbModel.setPrettyPrint(true);
soapjaxbModel.setIgnoreUnmarshalledHeaders(false);
soapjaxbModel.setIgnoreJAXBElement(false);
soapjaxbModel.setElementNameStrategy(new TypeNameStrategy());
}
use of org.apache.camel.dataformat.soap.name.TypeNameStrategy in project camel by apache.
the class TypeNameStrategyTest method testNoPackageInfo.
@Test
public void testNoPackageInfo() {
TypeNameStrategy strategy = new TypeNameStrategy();
QName name = strategy.findQNameForSoapActionOrType("", AnnotatedClassWithoutNamespace.class);
Assert.assertEquals("test", name.getLocalPart());
Assert.assertEquals("##default", name.getNamespaceURI());
QName name2 = strategy.findQNameForSoapActionOrType("", AnnotatedClassWithNamespace.class);
Assert.assertEquals("test", name2.getLocalPart());
Assert.assertEquals("http://mynamespace", name2.getNamespaceURI());
}
Aggregations