use of javax.xml.soap.DetailEntry in project quickstarts by jboss-switchyard.
the class ReverseService method reverse.
@POST
@Path("/")
@WebMethod(action = "urn:switchyard-quickstart:camel-soap-proxy:1.0")
@WebResult(name = "text")
public String reverse(@WebParam(name = "text") String text) throws Exception {
if (text.equals("fault")) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault sf = factory.createFault("myfaultstring", new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE, "Server"));
sf.setFaultActor("myFaultActor");
Detail d = sf.addDetail();
QName entryName = new QName("urn:switchyard-quickstart:camel-soap-proxy:1.0", "order", "PO");
DetailEntry entry = d.addDetailEntry(entryName);
QName name = new QName("urn:switchyard-quickstart:camel-soap-proxy:1.0", "symbol");
SOAPElement symbol = entry.addChildElement(name);
symbol.addTextNode("SUNW");
throw new SOAPFaultException(sf);
}
return new StringBuilder(text).reverse().toString();
}
Aggregations