cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xbranko <>
Subject Re: Sending XML payload without encoding it
Date Tue, 10 Mar 2009 16:34:30 GMT

Andrew Clegg-2 wrote:
> I just found this message from last month...
> How did you get the SOAPAction header thing to work in the end? I have

I couldn't get the action to appear either, so finally this is what I ended
up with:

      String xmlPayload = "<yourXML>...</yourXML>";
      Service service = Service.create(new URL(wsdl), SERVICE_NAME);
      InputStream is =  new ByteArrayInputStream(xmlPayload.getBytes());
      SOAPMessage message = MessageFactory.newInstance().createMessage(null,
      DOMSource request = new
      Dispatch<DOMSource> disp = service.createDispatch(PORT_NAME,
DOMSource.class, Service.Mode.PAYLOAD);
      DOMSource result = disp.invoke(request);
      DOMResult domResponse = new DOMResult();
      Transformer trans = TransformerFactory.newInstance().newTransformer();
      trans.transform(result, domResponse);
    catch(Exception e)

Ideally, the CXF team would implement an annotation for parameter (say
@NoEncoding) that would just pass the content as is, i.e. without any XML
character encoding. Hey CXF team -- how about that?
View this message in context:
Sent from the cxf-user mailing list archive at

View raw message