Hi,

When you promote a service, you can further configure the interface which can be a subset of the operations of the original CalculatorService. The XML could look like:

<service name="CalculatorService" promote="CalculatorServiceComponent">
   <interface.java interface="calculator.LimitedCalculatorService/>
   <binding.ws/>
</service>

The LimitedCalculatorService can just have a subset of the desired methods from CalculatorService.

Thanks,
Raymond
--------------------------------------------------
From: "Abraham Washington" <[EMAIL PROTECTED]>
Sent: Wednesday, April 30, 2008 8:25 AM
To: <tuscany-user@ws.apache.org>
Subject: Re: wsdl reference question

sorry, should have included the code. this is just the calculator-ws-webapp composite (which is below). i added this code: <service name="CalculatorService" promote="CalculatorServiceComponent"><binding.ws/></service> which exposes the CalculatorService. but, now the wsdl has operations like:
setAddService
setDivideService
i don't want to expose the methods to the outside world. is there a way around that ?
thx abe<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
targetNamespace="http://sample";
xmlns:sample="http://sample";
name="Calculator"><service name="CalculatorService" promote="CalculatorServiceComponent"><binding.ws/></service><component name="CalculatorServiceComponent">
<implementation.java class="calculator.CalculatorServiceImpl"/>
<reference name="addService" >
<interface.java interface="calculator.AddService" />
<binding.ws uri="http://localhost:8080/sample-calculator-ws-webapp/AddServiceComponent"/>
</reference>
<reference name="subtractService" target="SubtractServiceComponent"></reference> <reference name="multiplyService" target="MultiplyServiceComponent"></reference> <reference name="divideService" target="DivideServiceComponent"></reference>
</component>
<component name="AddServiceComponent">
<implementation.java class="calculator.AddServiceImpl"/>
<service name="AddService">
<interface.java interface="calculator.AddService" />
<binding.ws/>
</service>
</component>
<component name="SubtractServiceComponent">
<implementation.java class="calculator.SubtractServiceImpl"/>
</component>
<component name="MultiplyServiceComponent">
<implementation.java class="calculator.MultiplyServiceImpl"/>
</component>
<component name="DivideServiceComponent">
<implementation.java class="calculator.DivideServiceImpl"/>
</component>
</composite>



----- Original Message ----
From: Mike Edwards <[EMAIL PROTECTED]>
To: tuscany-user@ws.apache.org
Sent: Wednesday, April 30, 2008 4:41:26 AM
Subject: Re: wsdl reference question

Abraham Washington wrote:
hi all, i have a service that has a reference to another service.� so,
in my impl class there's a setter method for the reference.�� when the
app is deployed, the wsdl generates the setter method operation, thus
making it available to be invoked (not a good thing).�
is there a way around this ?
thx abe


____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Hi Abe,

Can you explain what your app is doing in some more detail - maybe post
some code and the composite file?

If you have declared a reference in your code, with a setter method,
then I would expect the setter method to get called at runtime with the
reference proxy for the target service that you configure in your
composite file.

For the setter method to get included in the WSDL generated for the
service offered by the component, then:

a) presumably you are not marking the service offered by the
implementation code, so that the defaulting process is happening
- you do this by using the @Service annotation

b) also, I suspect that your class does not say something like

public fooClass implements barInterface {
...
}

- since the default service generation will look at the barInterface to
generate the WSDL for the service. If there is no "implements" clause
then the SCA code has little to go on as to which methods should be
included. In this case, as the SCA Java Client & Implementation
specification says:

"If none of the implemented interfaces is remotable, then by default the
implementation offers a single service whose type is the implementation
class."

I recommend that you consider using one of the above techniques to
control which class methods are used for the operations of the Service
interface.


Yours, Mike.




____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Reply via email to