I'm just creating a basic SOAP client from a WSDL, and I'd like to use
the CXF's conversion of SOAP faults to Java exceptions. In this simple
use case, the namespace definitions in the envelope should be available
in the parsing context when the fault detail is handled.
Can you suggest whether I should file this as a bug, or whether I should
attempt to workaround it (and how), or both?
Thanks,
Andrew
On 07/30/2015 05:10 AM, Aki Yoshida wrote:
Prefix xsd is actually bound to the correct xsd namespace in that soap
fault message. So this message shouldn't be causing any parsing error
within CXF.
If your setup is extracting the fault part directly without including
the namespace declarations from its parent context, that could lead to
the parsing error when parsing the extracted part. Camel had this
issue with CXF 3.x sometime ago.
What does your scenario/application look like? You may need a similar
approach to injecting the namespaces.
regards, aki
2015-07-29 21:08 GMT+02:00 Andrew Cleasby <[email protected]>:
I've created a SOAP service client from a WSDL and am having trouble getting
fault/exception handling working. The specific error I'm getting is:
java.lang.IllegalArgumentException: prefix xsd is not bound to a namespace
(I can provide the full stacktrace if necessary.)
This occurs when parsing the SOAP fault response:
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring/><detail><RuntimeFaultFault
xsi:type="vim25:InvalidArgument" xmlns="urn:pbm" xmlns:pbm="urn:pbm"
xmlns:vim25="urn:vim25"><vim25:faultMessage><vim25:key>com.vmware.pbm.pbmFault.locale</vim25:key><vim25:arg><vim25:key>summary</vim25:key><vim25:value
xsi:type="xsd:string">Invalid or null error
message(vmodl.fault.InvalidArgument) {
faultCause = null,
faultMessage = null,
invalidProperty = resourceType
}</vim25:value></vim25:arg></vim25:faultMessage><vim25:invalidProperty>resourceType</vim25:invalidProperty></RuntimeFaultFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I'm using version 3.1.1. I saw that
https://issues.apache.org/jira/browse/CXF-6319 was fixed in 3.1.0 and up,
but the problem I'm running into appears to be similar. Can anyone suggest
how to troubleshoot?
Thanks,
Andrew