Hi,
I think, that it could be better to have an approach, where wsdl is (
expanded )
and cleaned before it's deployed in the service unit ( automatically or
exposing a
menu inside eclipse tool ).
So basically what i've done is something like:
Definition def =
wsdlReader.readWSDL(wsdlFile.toURI().toString());
WSDLFlattener wsdlFlattener = new WSDLFlattener(def);
wsdlFlattener.initialize();
SchemaCollection schemas = wsdlFlattener.getSchemas();
if (schemas.getSize() > 0) {
Types types = def.createTypes();
for (Iterator it = schemas.getSchemas().iterator();
it.hasNext();) {
javax.wsdl.extensions.schema.Schema imp = new
SchemaImpl();
imp.setElement(((Schema)it.next()).getRoot());
imp.setElementType(new
QName("http://www.w3.org/2001/XMLSchema", "schema"));
types.addExtensibilityElement(imp);
}
def.setTypes(types);
}
then i regenerate the wsdl.
This basically means that in the wsdl within the service unit, i've a
clean wsdl, and all
is working very well.
In some cases, we need to be compliant with wsdl that we can not touch (
the only thing
i'll do on this is to modify the wsdl to map, correctly the port and
service element to xbean.xml )
I think that it could be a problem to have more than one port in wsdl,
in that case when
we attach this to the service unit, we're going to ask whicj port will
be mapped to
jbi endpoint.
In case we've multiple port, what's the best way to proceed??
Does this approach work for you??
Andrea
Guillaume Nodet ha scritto:
The WSDLFlattener do two things iirc:
* include imported wsdl and schemas so that the service
can expose a single standalone WSDL as required by
JBI 1.0
* in doing so, it only extracts a single portType (iirc)
I think the CXF-BC could make use of the wsdl flattener
if it is not the case yet (i can't recall), so feel free to
raise a JIRA (and provide a patch if possible).
Why do you need your WSDL to contain other ports ?
On Feb 1, 2008 10:48 AM, Andrea Zoppello <[EMAIL PROTECTED]> wrote:
Hi all,
I'm beginning to use CXF-BC, in some use case where i need to expose
my sa ( process )
with a particular wsdl interface that is predefined, and i cannot
*autogenerate*.
So the aim is to use CXF-BC where i've just the wsdl.
The problem, is that this wsdl, contains, some *xsd import*
instructions, with schemaLocation
attribute. For this reason i've seen in servicemix there's an utility
class WSDLFlattener that
could make me happy to avoid locations import in wsdl.
BTW i need to flatten the original WSDL definition, for all the port
type defined in the wsdl.
The WSDLFlattener seems to cover the use case, only if i want to get a
flattened for
a particular portType.
Is possible to modify the WSDLFlattener so to flatten all portType???
Andrea