I don't get it... How does building the XML payload differently mean you get a SOAPAction header? Or do you mean, when you do it this way, you don't need a SOAPAction header?
In my case, I absolutely need a SOAPAction header matching the WSDL, because it's some weird Perl service implementation, and this: _dispatch.getRequestContext().put( BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE ); _dispatch.getRequestContext().put( BindingProvider.SOAPACTION_URI_PROPERTY, "the action URI" ); isn't making *any* difference at all :-( No matter how I try to rephrase it, Wireshark just shows: SOAPAction: "" in the outbound request, and the remote service throws an error. I have debugged into the code to some extent and those put() calls are definitely taking place. Sorry, I know your problem was a little different from mine, but I was really hoping you'd figured out what the right magic words were :-) Andrew. 2009/3/10 xbranko <xbra...@netscape.net>: > > > 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: > > try > { > 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, > is); > DOMSource request = new > DOMSource(message.getSOAPBody().extractContentAsDocument()); > > 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) > { > e.printStackTrace(); > } > > 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: > http://www.nabble.com/Sending-XML-payload-without-encoding-it-tp21925398p22438203.html > Sent from the cxf-user mailing list archive at Nabble.com. > > -- :: http://biotext.org.uk/ ::