Yeah, I brought this up once before but never did anything about it. We need
a much more robust way to select the appropriate namespace. One option would
be to just loop through the elements until we find a bindingfactory:
BindingFactory bindingFactory = null;
for (ExtensibilityElement e : extensibilityElements) {
bindingFactory = bindingFactoryManager.getBinding(e.getElementType
().getNamespaceURI());
if (bindingFactory != null) break;
}
Regards,
- Dan
On 12/5/06, Li, Tao (Tom) <[EMAIL PROTECTED]> wrote:
Hi Andrea,
Currently, if a wsdl file contains ws-policy assertions,
our cxf can't build service model correctly.
In WSDLServiceBuilder.buildBinding method, it assumed that
the first ext element is the one specify the protocol (such
as soap), but if the wsdl has ws-policy assertion, the first
element of binding may be the wsp:PolicyReference.
our code:
String ns = ((ExtensibilityElement)binding.getExtensibilityElements()
.get(0)).getElementType().getNamespaceURI();
wsdl sample:
<wsdl:binding name="BasicHttpBinding_IMtomTest" type="i0:IMtomTest">
<wsp:PolicyReference URI="#BasicHttpBinding_IMtomTest_policy" />
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
...
But what make me confused is when I look up the wsdl spec
(http://www.w3.org/TR/wsdl), I found the binding chapter specify
the binding part should like below:
Digest from http://www.w3.org/TR/wsdl
The grammar for a binding is as follows:
<wsdl:definitions .... >
<wsdl:binding name="nmtoken" type="qname"> *
<-- extensibility element (1) --> *
<wsdl:operation name="nmtoken"> *
<-- extensibility element (2) --> *
<wsdl:input name="nmtoken"? > ?
<-- extensibility element (3) -->
</wsdl:input>
<wsdl:output name="nmtoken"? > ?
<-- extensibility element (4) --> *
</wsdl:output>
<wsdl:fault name="nmtoken"> *
<-- extensibility element (5) --> *
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
Could we add a filter out map in WSDLServiceBuilder to filter out any
well-known elements namespace which may precedes the protocol element of
the binding to solve this type problem.
Thanks.
Tom
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog