use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class CustomHandler method handleInbound.
@Override
protected boolean handleInbound(SOAPMessageContext msgContext) {
log.info("handleInbound");
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPBodyElement soapBodyElement = (SOAPBodyElement) soapBody.getChildElements().next();
SOAPElement soapElement = (SOAPElement) soapBodyElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + "|CustomIn");
} catch (SOAPException e) {
throw new WebServiceException(e);
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class CustomHandler method handleOutbound.
@Override
protected boolean handleOutbound(SOAPMessageContext msgContext) {
log.info("handleOutbound");
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPBodyElement soapBodyElement = (SOAPBodyElement) soapBody.getChildElements().next();
SOAPElement soapElement = (SOAPElement) soapBodyElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + "|CustomOut");
} catch (SOAPException e) {
throw new WebServiceException(e);
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class ClientHandler method handleInbound.
@Override
public boolean handleInbound(SOAPMessageContext msgContext) {
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
SOAPElement soapElement = (SOAPElement) soapMessage.getSOAPBody().getChildElements().next();
soapElement = (SOAPElement) soapElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + ":" + nsURI);
return true;
} catch (SOAPException ex) {
throw new WebServiceException(ex);
}
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class ServerHandler method handleInbound.
@Override
public boolean handleInbound(SOAPMessageContext msgContext) {
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
nsURI = soapEnvelope.getNamespaceURI();
return true;
} catch (SOAPException ex) {
throw new WebServiceException(ex);
}
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class SOAPConnectionImpl method get.
@Override
public SOAPMessage get(Object addressObject) throws SOAPException {
checkClosed();
String address = getAddress(addressObject);
ConduitInitiator ci = getConduitInitiator(address);
// create a new Message and Exchange
EndpointInfo info = new EndpointInfo();
info.setAddress(address);
Message outMessage = new MessageImpl();
Exchange exch = new ExchangeImpl();
outMessage.setExchange(exch);
// sent GET request
try {
// TODO verify bus
final Conduit c = ci.getConduit(info, BusFactory.getThreadDefaultBus(false));
if (c instanceof HTTPConduit) {
((HTTPConduit) c).getClient().setAutoRedirect(true);
}
outMessage.put(Message.HTTP_REQUEST_METHOD, "GET");
c.prepare(outMessage);
c.setMessageObserver(createMessageObserver(c));
c.close(outMessage);
} catch (Exception ex) {
throw MESSAGES.getRequestCouldNotBeSent(ex);
}
// read SOAPMessage
return readSoapMessage(exch);
}
Aggregations