Search in sources :

Example 1 with DetailEntry

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();
}
Also used : QName(javax.xml.namespace.QName) DetailEntry(javax.xml.soap.DetailEntry) SOAPElement(javax.xml.soap.SOAPElement) SOAPFault(javax.xml.soap.SOAPFault) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) SOAPFactory(javax.xml.soap.SOAPFactory) Detail(javax.xml.soap.Detail) Path(javax.ws.rs.Path) WebMethod(javax.jws.WebMethod) POST(javax.ws.rs.POST) WebResult(javax.jws.WebResult)

Aggregations

WebMethod (javax.jws.WebMethod)1 WebResult (javax.jws.WebResult)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1 QName (javax.xml.namespace.QName)1 Detail (javax.xml.soap.Detail)1 DetailEntry (javax.xml.soap.DetailEntry)1 SOAPElement (javax.xml.soap.SOAPElement)1 SOAPFactory (javax.xml.soap.SOAPFactory)1 SOAPFault (javax.xml.soap.SOAPFault)1 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)1