It SOUNDS like the SOAPAction header is either not being set on the wire or is set wrong. Can you wireshark the transfer to make sure the SOAPAction is properly set in the header. Also, check the wsdl for the server to make sure "ServiceX" is the correct action for the method you are invoking.
Dan On Mon February 9 2009 7:41:20 pm xbranko wrote: > Tried with both CXF 2.0.9 and 2.1.3: > > I need to send payload that is XML. When I do, the content is encoded (i.e. > all '<' are replaced with <, '>' with > etc.), and the server throws > an exception because it doesn't expect payload to be encoded. I verified > that using soapui which sends the pure XML and receives correct answer from > the server. > > Searching through the forum, I've implemented the alternative approach: > > Service service = Service.create(new URL(wsdl), SERVICE_NAME); > > DocumentBuilderFactory factory = > DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); > DocumentBuilder builder = factory.newDocumentBuilder(); > InputStream is = new StringBufferInputStream(xmlPayload); > Document newDoc = builder.parse(is); > DOMSource request = new DOMSource(newDoc); > > Dispatch<Source> disp = service.createDispatch(PORT_NAME, > Source.class, Service.Mode.PAYLOAD); > > disp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, > Boolean.TRUE); > disp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, > "ServiceX"); > > Source result = disp.invoke(request); > > With this approach, the server is returning: > "Unable to handle request without a valid action parameter. Please supply a > valid soap action." > > I followed the code in the debugger, and saw that action parameter is being > set in the code, however, it does not get written out as part of the POST > request -- verified via the Network Protocol Analyzer -- the action is not > there. > > Is there a third way? Ideally, I'd like to use the standard way, and just > indicate to CXF to do nothing with the payload, to just pass it through as > is. > > Any help greatly appreciated! -- Daniel Kulp [email protected] http://www.dankulp.com/blog
