[MOBY-l] MobyRequest problem
Paul Gordon
gordonp at cbr.nrc.ca
Fri Jun 11 14:38:24 UTC 2004
Hey folks,
Now that we have different clients, and different servers running,
we see the ugly face of interoperability :-P
The major issue here is that the Java client is not finding the SOAP
base64 encoded payload because the XPath expression used to find it in
the SOAP envelope is
//*[@xsi:type="SOAP-ENC:base64"]
This has two issues, one is easy to fix, the other not so. XML Schema
Instances are wierd because they use prefixes like SOAP-ENC to describe
the namespace of tags. But that prefix is not part of the syntax of the
XML document, it's just CDATA in an attribute. But the prefix
declaration is done in the document (xmlns:SOAP-ENC="http://....").
There is no systematic way to apply the declared prefix to the
xsi:type="SOAP-ENC:base64" bit, since it's just CDATA. Anyhow, we can
avoid this whole match-the-variable-prefix-to-a-XSI-meta-data-namespace
problem by changing the XPath to be more inclusive. Just looking at the
local name (i.e. unprefixed) part of the CDATA after the colon
//*[substring-after(@xsi:type, ':')=\"base64\"]"
at the very slight risk that you have other top-level SOAP envelope XSI
declarations of "base64" that aren't SOAP (i.e. you're doing some very
wierd handtweaking of the SOAP envelope with element name collision).
The second problem is that Perl service providers use as module that
uses the XML Schema Instance namespace of
http://www.w3.org/1999/XMLSchema-instance, whereas Apache's Java Axis
uses http://www.w3.org/2001/XMLSchema-instance. So should the XPath
bind xsi: to the the former or the latter? For now I had hardcoded in
the 1999 version, since most service providers were using the Perl
modules. See the MobyPrefixResover code and its accompanying comment
else if(XSI_PREFIX.equals(prefix)){
return XSI_NAMESPACE1999; //Crappy Perl XML Schema namespace usage
is out of date
}
You see, I precompile the XPath statements for speed, so I need to know
beforehand if 1999 or 2001 namespace will be used. Ben, can you make
your Echo service available with a real IP address? That way I can try
to fix this with multiple XSI resolutions and test it before commiting.
More information about the moby-l
mailing list