You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Deepal Jayasinghe <de...@opensource.lk> on 2005/12/22 04:12:54 UTC
[Axis2] Default Message Receivers
Hi all;
I came up with the following way of specifying default message receivers it can be either or both in axis2.xml and services.xml. Service can override global Message receivers by adding the same element in services.xml.
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
</messageReceivers>
So at the deployment time if there is an operation without a MessageReciver specified for that and have the MEP specified then depending on the mep correct default message receiver will be selected.
If operation have not indicate the MEP , then the default mep will be in-out
Thanks,
Deepal
................................................................
~Future is Open~
Re: [Axis2] Default Message Receivers
Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Thu, 2005-12-22 at 10:59 +0600, Deepal Jayasinghe wrote:
> yes , from Java code I know the MEP, but if the WSDL is not there in
> archive file what I do is first create a AxisService using services.xml and
> then get its serviceClass parameter and using that class generate Schema and
> fill Axis* , therefore in that case if the user does not specify the MEP in
> operation tag of service.xml I assume that as in-out.
OK I'm confused. Let me try to replay the order:
- if have WSDL then
- do WSDL2Axis* to get AxisService
else
- find serviceClass from service.xml
- load that class
- do Java2Axis* on that class
- now done because we have MEPs for all methods
endif
- for all operations listed in service.xml
- if that operation is not in the AxisService then error
- change default info using operation specific info
If that's the logic there's no place where we don't know the MEP. What
am I missing?
Sanjiva.
Re: [Axis2] Default Message Receivers
Posted by Deepal Jayasinghe <de...@opensource.lk>.
> On Thu, 2005-12-22 at 09:12 +0600, Deepal Jayasinghe wrote:
>> Hi all;
>>
>> I came up with the following way of specifying default message
>> receivers it can be either or both in axis2.xml and services.xml.
>> Service can override global Message receivers by adding the same
>> element in services.xml.
>> <messageReceivers>
>> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>>
>> class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>>
>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>> </messageReceivers>
>
> +1!
>
>> So at the deployment time if there is an operation without a
>> MessageReciver specified for that and have the MEP specified then
>> depending on the mep correct default message receiver will be
>> selected.
>
> Do I understand correctly that if I want to use a custom message
> receiver for a specific operation I can do:
>
> <service>
> <operation name="foo">
> <messageReceiver mep="xx" class="yy"/>
> </operation>
> </service>
yes you can do that way, I give the higher precedence to operation
message receiver , and set a default message receiver only if operation dose
not specify a message receiver.
>
> If so cool! If not, um, why not? :)
>
>> If operation have not indicate the MEP , then the default mep will be
>> in-out
>
> I don't see how an operation will not specify a MEP with our deployment
> model: either you have a WSDL or we manufacture one for you. If we
> manufacture from Java code we know the MEP: In-Out. Is that what you
> meant?
yes , from Java code I know the MEP, but if the WSDL is not there in
archive file what I do is first create a AxisService using services.xml and
then get its serviceClass parameter and using that class generate Schema and
fill Axis* , therefore in that case if the user does not specify the MEP in
operation tag of service.xml I assume that as in-out.
>
> Sanjiva.
>
>
Re: [Axis2] Default Message Receivers
Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Thu, 2005-12-22 at 09:12 +0600, Deepal Jayasinghe wrote:
> Hi all;
>
> I came up with the following way of specifying default message
> receivers it can be either or both in axis2.xml and services.xml.
> Service can override global Message receivers by adding the same
> element in services.xml.
> <messageReceivers>
> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>
> class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
> </messageReceivers>
+1!
> So at the deployment time if there is an operation without a
> MessageReciver specified for that and have the MEP specified then
> depending on the mep correct default message receiver will be
> selected.
Do I understand correctly that if I want to use a custom message
receiver for a specific operation I can do:
<service>
<operation name="foo">
<messageReceiver mep="xx" class="yy"/>
</operation>
</service>
If so cool! If not, um, why not? :)
> If operation have not indicate the MEP , then the default mep will be
> in-out
I don't see how an operation will not specify a MEP with our deployment
model: either you have a WSDL or we manufacture one for you. If we
manufacture from Java code we know the MEP: In-Out. Is that what you
meant?
Sanjiva.