I just found this message from last month...

How did you get the SOAPAction header thing to work in the end? I have
the same problem as you had -- I'm doing this in the code:

rc.put( BindingProvider.SOAPACTION_URI_PROPERTY, "string containing
soap action" );
rc.put( BindingProvider.SOAPACTION_USE_PROPERTY, true );

where rc is the RequestContext of my Dispatch object. But it isn't
appearing on the wire.

Thanks,

Andrew.

2009/2/10 xbranko <[email protected]>:
>
> 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 &lt;, '>' with &gt; 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!
> --
> View this message in context: 
> http://www.nabble.com/Sending-XML-payload-without-encoding-it-tp21925398p21925398.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>



-- 
:: http://biotext.org.uk/ ::

Reply via email to