On Tuesday, April 24, 2012 08:06:34 AM yuflyud wrote:
> Yes it works! Thank you! What is you advise about Source implementation to
> use (DOMSource, SAXSource..)?

That completely depends on what is easiest for you to use and what you are 
trying to achieve. 

In general, I usually just suggest "Source" as the parameter type.  What 
you'll normally get in that case is a StaxSource where you could get the raw 
XMLStreamReader if you want that but could also use it for other parsing 
things.    With XML Security, you may get a DOMSource then since we do have 
the DOM.  Not really sure.  Might be a StaxSource with a W3CDOMStreamReader 
where you could get the DOM.

On the return, when you use "Source", you can use whatever Source is best 
for you.  If you build a DOM, return a DOMSource.  If you have SAX events, 
return a SAXSource.    Completely up to you.


The rest of this looks like a bug.   Somehow the "role" is null in the 
SoapFault and we're not checking for that.

Dan



> Also I have one more issue:
> When server returns fail it looks like this:
> 
> Action name:
> <a:Action s:mustUnderstand="1"
> u:Id="_4">http://.../ExecuteOrganizationServiceFaultFault</a:Action>
> Body is encrypted.
> 
> It's OK, but the following exception is thrown:
> 
> org.apache.ws.security.WSSecurityException: The signature or decryption
> was invalid
>       at
> org.apache.ws.security.processor.SignatureProcessor.verifyXMLSignature(Sig
> natureProcessor.java:407) ...
> ...
> ...
> Exception in thread "main" java.lang.NullPointerException
>       at
> com.sun.xml.messaging.saaj.soap.impl.ElementImpl.addTextNode(ElementImpl.j
> ava:454) at
> com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl.setFaultRole(Fault1_2I
> mpl.java:338) at
> com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl.setFaultActor(Fault1_2
> Impl.java:574) at
> org.apache.cxf.jaxws.JaxWsClientProxy.createSoapFault(JaxWsClientProxy.jav
> a:219) at
> org.apache.cxf.jaxws.DispatchImpl.mapException(DispatchImpl.java:278) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:389) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:242) at
> com.ibi.xrmclient.XRMClient.main(XRMClient.java:76)
> 
> Why can't I retrieve the body of the message? I know that there is an
> error description there.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/How-to-resolve-PolicyReference-using-Disp
> atch-API-tp5651158p5662311.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to