You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by kcorbin <ke...@gmail.com> on 2012/03/14 22:32:42 UTC
Soap FaultCode prefix
I have an issue where our soap client does not handle prefixes in the
faultCode field. SO I am looking for a way to remove this.
To be clear...
This is what is being returned for the fault:
<faultcode>soap:Client.ItemNotFound</faultcode>
This is what I want:
<faultcode>Client.ItemNotFound</faultcode>
I am already using a faultInterceptor to generate the fault from a custom
exception type. I have tried when setting the faultCode to specify an empty
string as a prefix:
fault.setFaultCode(new QName("", e.getFaultCode(), ""));
However, this has no effect. I can specify another prefix
fault.setFaultCode(new QName("", e.getFaultCode(), "xx"));
and the result is what I would expect:
<faultcode>xx:Client.ItemNotFound</faultcode>
Is there a way to get no prefix to show up? If I wanted to remove a
specific prefix (xx for example) in a later Phase interceptor how would I do
that? (For example is there an interceptor I can use to do a raw text
transform on the SOAP message to replace "xx:" with "")
Thanks in advance for your help.
Keith
--
View this message in context: http://cxf.547215.n5.nabble.com/Soap-FaultCode-prefix-tp5566273p5566273.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Soap FaultCode prefix
Posted by Aki Yoshida <el...@googlemail.com>.
If you want to physically make the prefix "soap" removed, one option
is to set the soap namespace as the default namespace (i.e., the
namespace that does carries no prefix).
If you are using the jaxws endpoint, you can set the soap.env.ns.map property as
<jaxws:properties>
<entry key="soap.env.ns.map">
<map>
<entry key="" value="http://schemas.xmlsoap.org/soap/envelope/"/>
</map>
</entry>
...
regards, aki
2012/3/14 kcorbin <ke...@gmail.com>:
> I have an issue where our soap client does not handle prefixes in the
> faultCode field. SO I am looking for a way to remove this.
>
> To be clear...
>
> This is what is being returned for the fault:
> <faultcode>soap:Client.ItemNotFound</faultcode>
>
> This is what I want:
> <faultcode>Client.ItemNotFound</faultcode>
>
> I am already using a faultInterceptor to generate the fault from a custom
> exception type. I have tried when setting the faultCode to specify an empty
> string as a prefix:
> fault.setFaultCode(new QName("", e.getFaultCode(), ""));
>
> However, this has no effect. I can specify another prefix
> fault.setFaultCode(new QName("", e.getFaultCode(), "xx"));
>
> and the result is what I would expect:
> <faultcode>xx:Client.ItemNotFound</faultcode>
>
> Is there a way to get no prefix to show up? If I wanted to remove a
> specific prefix (xx for example) in a later Phase interceptor how would I do
> that? (For example is there an interceptor I can use to do a raw text
> transform on the SOAP message to replace "xx:" with "")
>
> Thanks in advance for your help.
>
> Keith
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Soap-FaultCode-prefix-tp5566273p5566273.html
> Sent from the cxf-user mailing list archive at Nabble.com.