cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jim ma <>
Subject SAAJ for xop element
Date Mon, 04 Jan 2010 07:41:48 GMT
Hi all ,

When set the jaxws handler in client side to check if CXF 2.2.5 can
get the XOP element(xop:include element) content(encoded message) from
the SAAJ model . It looks like the SAAJIn/OutInterceptor does not
parse and inline the encoded request message in the "dataHandler"
element :

The expected document in SAAJ is:

<soap:Envelope xmlns:soap="">
    <ns2:echoDataHandler xmlns:ns2="">

The actual document in the SAAJ :

<soap:Envelope xmlns:soap="">

This is the handler code to check if the xop:include element has been
replaced to actual encoded message :

public boolean handleMessage(SOAPMessageContext ctx) {
		Object b = ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
		boolean outbound = (Boolean) b;
		if (!outbound) {
			try {
				SOAPMessage soapMsg = ctx.getMessage();
				SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
				SOAPBody body = soapEnv.getBody();
				boolean found = scanNodes(body.getChildNodes());

				if (found)
					throw new IllegalStateException("Failed to get the actual encoded
message ");

			} catch (SOAPException ex) {
				throw new WebServiceException(ex);

			return true;
		return true;


Below is the soap request message on wire . Metro seems can handle
this as I expected. So Is this an issue in CXF ?  Or this has been
defined in the SAAJ spc ?

---------------------Request message-----------------------
POST /jaxws-samples-xop-doclit/bare HTTP/1.1
Content-Type: multipart/related; type="application/xop+xml";
start="<>"; start-info="text/xml"
SOAPAction: ""
Accept: */*
User-Agent: Apache CXF 2.2.5
Cache-Control: no-cache
Pragma: no-cache
Connection: keep-alive
Content-Length: 807
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <>
<soap:Envelope xmlns:soap=""><soap:Body><ns2:echoDataHandler
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-ID: <ce273950-41cd-4447-b3b7-296c06672f7a-1@>
Client Data



View raw message