You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Andrea Smyth <an...@iona.com> on 2007/01/16 15:51:21 UTC

Service Model Extension

In the context of WS-Policy I have come accross the problem to retrieve 
wsp:Policy or wsp:PolicyReference elements attached not to wsdl:Service, 
wsdl:Port etc elements but appearing as children of the wsdl:definitions 
element. As such they cannot be currently be retrieved from out service 
model. Attached to e.g. a service element that would be possible via
List<UnknowExensibilityElement> extensions = 
ServiceInfo.getExtensions(UnknownExtensibilityElement.class);
for (UnknowExensibilityElement e : extensions) {
if (e.getElementType()).equal(new 
QName("http://schemas.xmlsoap.org/ws/2004/09/policy", 
"Policy[Reference]")) {
...
}


What do you think about extending the Service Model by something like a 
DescriptionInfo (wsdl 2.0 description <==> wsdl 1.1 definition)

class DescriptionInfo extends AbstractPropertiesHolder {
    // return value of description's name attribute
    String getName() {

   }

   // return list of top level elements (InterfaceInfo, BindingInfo, 
ServiceInfo etc...)
   List<Described> getDescribed() {
   }
}

class Described extends AbstractPropertiesHolder {
    DescriptionInfo getDescription() {
    }
}

class ServiceInfo  extends Described {
    // content as before
}

and same for BindingInfo, InterfaceInfo etc.

Cheers,
Andrea.


Re: Service Model Extension

Posted by Andrea Smyth <an...@iona.com>.
Balaji Ravi wrote:

> Thats what i thought too... apparently everything under definitions is
> getting added to the ServiceInfo... I agree it is a bit misleading...

I think that' a typo - everywhere else in WSDLServiceBuilder the 
extensions of the corresponding wsdl element are copied as extensions, e.g.
l. 249: copyExtensors(ei, port.getExtensibilityElements());
l. 266: copyExtensors(bi, binding.getExtensibilityElements());
etc.
l. 133 should probably read:
 copyExtensors(service, serv.getExtensibilityElements());

Andrea.

>
> - Balaji
>
> On 1/16/07, Andrea Smyth <an...@iona.com> wrote:
>
>>
>> Balaji Ravi wrote:
>>
>> > Hi andrea,
>> >
>> > In yoko(corba binding) also, we ran in to the same issue & it looks
>> > like all
>> > the elements defined under wsdl:definitions are exposed via the
>> > ServiceInfo
>> > class...
>> >
>> > The getExtensors(Class<T>) actually retrieves the extension 
>> elements...
>>
>> but that only retrieves the extensions on the wsdl:service element (and
>> same for BindingInfo, EndpointInfo, ServiceInfo, all derived from
>> AbstractPropertiesHolder)?
>> Andrea.
>>
>> >
>> > - Balaji
>> >
>> > On 1/16/07, Andrea Smyth <an...@iona.com> wrote:
>> >
>> >>
>> >> In the context of WS-Policy I have come accross the problem to 
>> retrieve
>> >> wsp:Policy or wsp:PolicyReference elements attached not to
>> wsdl:Service,
>> >> wsdl:Port etc elements but appearing as children of the
>> wsdl:definitions
>> >> element. As such they cannot be currently be retrieved from out 
>> service
>> >> model. Attached to e.g. a service element that would be possible via
>> >> List<UnknowExensibilityElement> extensions =
>> >> ServiceInfo.getExtensions(UnknownExtensibilityElement.class);
>> >> for (UnknowExensibilityElement e : extensions) {
>> >> if (e.getElementType()).equal(new
>> >> QName("http://schemas.xmlsoap.org/ws/2004/09/policy",
>> >> "Policy[Reference]")) {
>> >> ...
>> >> }
>> >>
>> >>
>> >> What do you think about extending the Service Model by something 
>> like a
>> >> DescriptionInfo (wsdl 2.0 description <==> wsdl 1.1 definition)
>> >>
>> >> class DescriptionInfo extends AbstractPropertiesHolder {
>> >>     // return value of description's name attribute
>> >>     String getName() {
>> >>
>> >>    }
>> >>
>> >>    // return list of top level elements (InterfaceInfo, BindingInfo,
>> >> ServiceInfo etc...)
>> >>    List<Described> getDescribed() {
>> >>    }
>> >> }
>> >>
>> >> class Described extends AbstractPropertiesHolder {
>> >>     DescriptionInfo getDescription() {
>> >>     }
>> >> }
>> >>
>> >> class ServiceInfo  extends Described {
>> >>     // content as before
>> >> }
>> >>
>> >> and same for BindingInfo, InterfaceInfo etc.
>> >>
>> >> Cheers,
>> >> Andrea.
>> >>
>> >>
>> >
>>
>>
>


Re: Service Model Extension

Posted by Balaji Ravi <ba...@gmail.com>.
Thats what i thought too... apparently everything under definitions is
getting added to the ServiceInfo... I agree it is a bit misleading...

- Balaji

On 1/16/07, Andrea Smyth <an...@iona.com> wrote:
>
> Balaji Ravi wrote:
>
> > Hi andrea,
> >
> > In yoko(corba binding) also, we ran in to the same issue & it looks
> > like all
> > the elements defined under wsdl:definitions are exposed via the
> > ServiceInfo
> > class...
> >
> > The getExtensors(Class<T>) actually retrieves the extension elements...
>
> but that only retrieves the extensions on the wsdl:service element (and
> same for BindingInfo, EndpointInfo, ServiceInfo, all derived from
> AbstractPropertiesHolder)?
> Andrea.
>
> >
> > - Balaji
> >
> > On 1/16/07, Andrea Smyth <an...@iona.com> wrote:
> >
> >>
> >> In the context of WS-Policy I have come accross the problem to retrieve
> >> wsp:Policy or wsp:PolicyReference elements attached not to
> wsdl:Service,
> >> wsdl:Port etc elements but appearing as children of the
> wsdl:definitions
> >> element. As such they cannot be currently be retrieved from out service
> >> model. Attached to e.g. a service element that would be possible via
> >> List<UnknowExensibilityElement> extensions =
> >> ServiceInfo.getExtensions(UnknownExtensibilityElement.class);
> >> for (UnknowExensibilityElement e : extensions) {
> >> if (e.getElementType()).equal(new
> >> QName("http://schemas.xmlsoap.org/ws/2004/09/policy",
> >> "Policy[Reference]")) {
> >> ...
> >> }
> >>
> >>
> >> What do you think about extending the Service Model by something like a
> >> DescriptionInfo (wsdl 2.0 description <==> wsdl 1.1 definition)
> >>
> >> class DescriptionInfo extends AbstractPropertiesHolder {
> >>     // return value of description's name attribute
> >>     String getName() {
> >>
> >>    }
> >>
> >>    // return list of top level elements (InterfaceInfo, BindingInfo,
> >> ServiceInfo etc...)
> >>    List<Described> getDescribed() {
> >>    }
> >> }
> >>
> >> class Described extends AbstractPropertiesHolder {
> >>     DescriptionInfo getDescription() {
> >>     }
> >> }
> >>
> >> class ServiceInfo  extends Described {
> >>     // content as before
> >> }
> >>
> >> and same for BindingInfo, InterfaceInfo etc.
> >>
> >> Cheers,
> >> Andrea.
> >>
> >>
> >
>
>

Re: Service Model Extension

Posted by Andrea Smyth <an...@iona.com>.
Balaji Ravi wrote:

> Hi andrea,
>
> In yoko(corba binding) also, we ran in to the same issue & it looks 
> like all
> the elements defined under wsdl:definitions are exposed via the 
> ServiceInfo
> class...
>
> The getExtensors(Class<T>) actually retrieves the extension elements...

but that only retrieves the extensions on the wsdl:service element (and 
same for BindingInfo, EndpointInfo, ServiceInfo, all derived from 
AbstractPropertiesHolder)?
Andrea.

>
> - Balaji
>
> On 1/16/07, Andrea Smyth <an...@iona.com> wrote:
>
>>
>> In the context of WS-Policy I have come accross the problem to retrieve
>> wsp:Policy or wsp:PolicyReference elements attached not to wsdl:Service,
>> wsdl:Port etc elements but appearing as children of the wsdl:definitions
>> element. As such they cannot be currently be retrieved from out service
>> model. Attached to e.g. a service element that would be possible via
>> List<UnknowExensibilityElement> extensions =
>> ServiceInfo.getExtensions(UnknownExtensibilityElement.class);
>> for (UnknowExensibilityElement e : extensions) {
>> if (e.getElementType()).equal(new
>> QName("http://schemas.xmlsoap.org/ws/2004/09/policy",
>> "Policy[Reference]")) {
>> ...
>> }
>>
>>
>> What do you think about extending the Service Model by something like a
>> DescriptionInfo (wsdl 2.0 description <==> wsdl 1.1 definition)
>>
>> class DescriptionInfo extends AbstractPropertiesHolder {
>>     // return value of description's name attribute
>>     String getName() {
>>
>>    }
>>
>>    // return list of top level elements (InterfaceInfo, BindingInfo,
>> ServiceInfo etc...)
>>    List<Described> getDescribed() {
>>    }
>> }
>>
>> class Described extends AbstractPropertiesHolder {
>>     DescriptionInfo getDescription() {
>>     }
>> }
>>
>> class ServiceInfo  extends Described {
>>     // content as before
>> }
>>
>> and same for BindingInfo, InterfaceInfo etc.
>>
>> Cheers,
>> Andrea.
>>
>>
>


Re: Service Model Extension

Posted by Balaji Ravi <ba...@gmail.com>.
Hi andrea,

In yoko(corba binding) also, we ran in to the same issue & it looks like all
the elements defined under wsdl:definitions are exposed via the ServiceInfo
class...

The getExtensors(Class<T>) actually retrieves the extension elements...

- Balaji

On 1/16/07, Andrea Smyth <an...@iona.com> wrote:
>
> In the context of WS-Policy I have come accross the problem to retrieve
> wsp:Policy or wsp:PolicyReference elements attached not to wsdl:Service,
> wsdl:Port etc elements but appearing as children of the wsdl:definitions
> element. As such they cannot be currently be retrieved from out service
> model. Attached to e.g. a service element that would be possible via
> List<UnknowExensibilityElement> extensions =
> ServiceInfo.getExtensions(UnknownExtensibilityElement.class);
> for (UnknowExensibilityElement e : extensions) {
> if (e.getElementType()).equal(new
> QName("http://schemas.xmlsoap.org/ws/2004/09/policy",
> "Policy[Reference]")) {
> ...
> }
>
>
> What do you think about extending the Service Model by something like a
> DescriptionInfo (wsdl 2.0 description <==> wsdl 1.1 definition)
>
> class DescriptionInfo extends AbstractPropertiesHolder {
>     // return value of description's name attribute
>     String getName() {
>
>    }
>
>    // return list of top level elements (InterfaceInfo, BindingInfo,
> ServiceInfo etc...)
>    List<Described> getDescribed() {
>    }
> }
>
> class Described extends AbstractPropertiesHolder {
>     DescriptionInfo getDescription() {
>     }
> }
>
> class ServiceInfo  extends Described {
>     // content as before
> }
>
> and same for BindingInfo, InterfaceInfo etc.
>
> Cheers,
> Andrea.
>
>