You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Arif Mohd <ar...@wipro.com> on 2007/08/02 10:36:34 UTC
Handling Faults in servicemix
Hi,
Iam using JSR181 component to expose an EJB method as a service and iam
throwing an exception from EJB method as follows
throw AxisFault.makeFault(ex);
My component setup is
...... -->eip:tap-->eip:pipeline-->eip:tap-->...
the xbean configuration for pipeline is
<eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
<eip:transformer>
<eip:exchange-target service="demo:my-service" />
</eip:transformer>
<eip:target>
<eip:exchange-target service="bescocr:myTap" />
</eip:target>
<eip:faultsTarget>
<eip:exchange-target service="bescocr:myQueue"/>
</eip:faultsTarget>
</eip:pipeline>
As intended when i get exception iam able to place the message in myQueue
But the message is like <stack>.....Complete stack trace...</stack>
I want a message which is an actual Soap Fault message like
<Fault><FaultString></FaultString>...
Am i doing any thing wrong while throwing exception? if so please help me
out in creating proper AxisFault object(which should contain user defined
error code,string and some extra info)
--
View this message in context: http://www.nabble.com/Handling-Faults-in-servicemix-tf4204826s12049.html#a11960536
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Handling Faults in servicemix
Posted by Arif Mohd <ar...@wipro.com>.
Hi Gert,
One more question,Iam also having some external webservices deployed in
JBoss server and iam calling them using http BC, please also let me know
what steps i have to take care to get proper Fault Message
Arif Mohd wrote:
>
> Yes i have given like this in the beginning of class definition as
> /**
> *@WebService(targetNamespace="_http://www.xxx.org/MyNamespace"
> name="ProvisionService")
> */
>
> and before the method declaration i given as
> /**
> *@WebMethod(operationName="retrieveProvisionDetails")
> *@WebFault name="AxisFlt" faultName="org.apache.axis.AxisFault"
> */
>
> is this correct?
>
> Gert Vanthienen wrote:
>>
>> Arif Mohd,
>>
>> Have you tried adding a @WebService annotation in your Java class?
>>
>> Gert
>>
>> Arif Mohd wrote:
>>> Gert,
>>> One thing i forgot to specify iam using a normal java class
>>> file(MyService), this will call a business method on a handler class,
>>> the
>>> handler class will inturn delegate the call to EJB's by using JNDI
>>> lookup
>>> and MyService class is exposed as a POJO to JSR181
>>>
>>> configuration for JSR181 is as follows
>>>
>>> <jsr181:endpoint pojoClass="com.xxx.processor.MyService"
>>> annotations="none"
>>> service="demo:my-service"
>>> endpoint="my-service" />
>>>
>>> I tried by giving annotations="java5" and annotations="jsr181" but when
>>> iam
>>> deploying the component it is giving the error saying
>>>
>>> <loc-message>Class com.xxx.processor.MyService does not have a
>>> WebService a
>>> nnotation</loc-message>
>>>
>>> i have given the annotation as follows in the class MyService for one of
>>> the
>>> method
>>> @WebFault name="AxisFlt" faultName="org.apache.axis.AxisFault"
>>>
>>> what is the change required in MyService class, it is a simple POJO
>>> which
>>> delegates the call to a handler.
>>>
>>>
>>> Gert Vanthienen wrote:
>>>
>>>> Arif Mohd,
>>>>
>>>> Did you declare the AxisFault on your JSR-181 @WebMethod? Does the
>>>> fault definition show up in your service's WSDL?
>>>>
>>>> Gert
>>>>
>>>> Arif Mohd wrote:
>>>>
>>>>> Hi,
>>>>> Could any body tell me what am i doing wrong here?
>>>>>
>>>>> Arif Mohd wrote:
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Iam using JSR181 component to expose an EJB method as a service
>>>>>> and
>>>>>> iam
>>>>>> throwing an exception from EJB method as follows
>>>>>> throw AxisFault.makeFault(ex);
>>>>>>
>>>>>> My component setup is
>>>>>>
>>>>>> ...... -->eip:tap-->eip:pipeline-->eip:tap-->...
>>>>>>
>>>>>> the xbean configuration for pipeline is
>>>>>>
>>>>>> <eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
>>>>>> <eip:transformer>
>>>>>> <eip:exchange-target service="demo:my-service" />
>>>>>> </eip:transformer>
>>>>>> <eip:target>
>>>>>> <eip:exchange-target service="bescocr:myTap" />
>>>>>> </eip:target>
>>>>>> <eip:faultsTarget>
>>>>>> <eip:exchange-target service="bescocr:myQueue"/>
>>>>>> </eip:faultsTarget>
>>>>>> </eip:pipeline>
>>>>>>
>>>>>> As intended when i get exception iam able to place the message in
>>>>>> myQueue
>>>>>>
>>>>>> But the message is like <stack>.....Complete stack trace...</stack>
>>>>>>
>>>>>> I want a message which is an actual Soap Fault message like
>>>>>> <Fault><FaultString></FaultString>...
>>>>>>
>>>>>> Am i doing any thing wrong while throwing exception? if so please
>>>>>> help
>>>>>> me
>>>>>> out in creating proper AxisFault object(which should contain user
>>>>>> defined
>>>>>> error code,string and some extra info)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Handling-Faults-in-servicemix-tf4204826s12049.html#a11980578
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Handling Faults in servicemix
Posted by Arif Mohd <ar...@wipro.com>.
Yes i have given like this in the beginning of class definition as
/**
*@WebService(targetNamespace="_http://www.xxx.org/MyNamespace"
name="ProvisionService")
*/
and before the method declaration i given as
/**
*@WebMethod(operationName="retrieveProvisionDetails")
*@WebFault name="AxisFlt" faultName="org.apache.axis.AxisFault"
*/
is this correct?
Gert Vanthienen wrote:
>
> Arif Mohd,
>
> Have you tried adding a @WebService annotation in your Java class?
>
> Gert
>
> Arif Mohd wrote:
>> Gert,
>> One thing i forgot to specify iam using a normal java class
>> file(MyService), this will call a business method on a handler class, the
>> handler class will inturn delegate the call to EJB's by using JNDI lookup
>> and MyService class is exposed as a POJO to JSR181
>>
>> configuration for JSR181 is as follows
>>
>> <jsr181:endpoint pojoClass="com.xxx.processor.MyService"
>> annotations="none"
>> service="demo:my-service"
>> endpoint="my-service" />
>>
>> I tried by giving annotations="java5" and annotations="jsr181" but when
>> iam
>> deploying the component it is giving the error saying
>>
>> <loc-message>Class com.xxx.processor.MyService does not have a WebService
>> a
>> nnotation</loc-message>
>>
>> i have given the annotation as follows in the class MyService for one of
>> the
>> method
>> @WebFault name="AxisFlt" faultName="org.apache.axis.AxisFault"
>>
>> what is the change required in MyService class, it is a simple POJO which
>> delegates the call to a handler.
>>
>>
>> Gert Vanthienen wrote:
>>
>>> Arif Mohd,
>>>
>>> Did you declare the AxisFault on your JSR-181 @WebMethod? Does the
>>> fault definition show up in your service's WSDL?
>>>
>>> Gert
>>>
>>> Arif Mohd wrote:
>>>
>>>> Hi,
>>>> Could any body tell me what am i doing wrong here?
>>>>
>>>> Arif Mohd wrote:
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> Iam using JSR181 component to expose an EJB method as a service and
>>>>> iam
>>>>> throwing an exception from EJB method as follows
>>>>> throw AxisFault.makeFault(ex);
>>>>>
>>>>> My component setup is
>>>>>
>>>>> ...... -->eip:tap-->eip:pipeline-->eip:tap-->...
>>>>>
>>>>> the xbean configuration for pipeline is
>>>>>
>>>>> <eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
>>>>> <eip:transformer>
>>>>> <eip:exchange-target service="demo:my-service" />
>>>>> </eip:transformer>
>>>>> <eip:target>
>>>>> <eip:exchange-target service="bescocr:myTap" />
>>>>> </eip:target>
>>>>> <eip:faultsTarget>
>>>>> <eip:exchange-target service="bescocr:myQueue"/>
>>>>> </eip:faultsTarget>
>>>>> </eip:pipeline>
>>>>>
>>>>> As intended when i get exception iam able to place the message in
>>>>> myQueue
>>>>>
>>>>> But the message is like <stack>.....Complete stack trace...</stack>
>>>>>
>>>>> I want a message which is an actual Soap Fault message like
>>>>> <Fault><FaultString></FaultString>...
>>>>>
>>>>> Am i doing any thing wrong while throwing exception? if so please help
>>>>> me
>>>>> out in creating proper AxisFault object(which should contain user
>>>>> defined
>>>>> error code,string and some extra info)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Handling-Faults-in-servicemix-tf4204826s12049.html#a11980206
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Handling Faults in servicemix
Posted by Gert Vanthienen <ge...@skynet.be>.
Arif Mohd,
Have you tried adding a @WebService annotation in your Java class?
Gert
Arif Mohd wrote:
> Gert,
> One thing i forgot to specify iam using a normal java class
> file(MyService), this will call a business method on a handler class, the
> handler class will inturn delegate the call to EJB's by using JNDI lookup
> and MyService class is exposed as a POJO to JSR181
>
> configuration for JSR181 is as follows
>
> <jsr181:endpoint pojoClass="com.xxx.processor.MyService"
> annotations="none"
> service="demo:my-service"
> endpoint="my-service" />
>
> I tried by giving annotations="java5" and annotations="jsr181" but when iam
> deploying the component it is giving the error saying
>
> <loc-message>Class com.xxx.processor.MyService does not have a WebService a
> nnotation</loc-message>
>
> i have given the annotation as follows in the class MyService for one of the
> method
> @WebFault name="AxisFlt" faultName="org.apache.axis.AxisFault"
>
> what is the change required in MyService class, it is a simple POJO which
> delegates the call to a handler.
>
>
> Gert Vanthienen wrote:
>
>> Arif Mohd,
>>
>> Did you declare the AxisFault on your JSR-181 @WebMethod? Does the
>> fault definition show up in your service's WSDL?
>>
>> Gert
>>
>> Arif Mohd wrote:
>>
>>> Hi,
>>> Could any body tell me what am i doing wrong here?
>>>
>>> Arif Mohd wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> Iam using JSR181 component to expose an EJB method as a service and
>>>> iam
>>>> throwing an exception from EJB method as follows
>>>> throw AxisFault.makeFault(ex);
>>>>
>>>> My component setup is
>>>>
>>>> ...... -->eip:tap-->eip:pipeline-->eip:tap-->...
>>>>
>>>> the xbean configuration for pipeline is
>>>>
>>>> <eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
>>>> <eip:transformer>
>>>> <eip:exchange-target service="demo:my-service" />
>>>> </eip:transformer>
>>>> <eip:target>
>>>> <eip:exchange-target service="bescocr:myTap" />
>>>> </eip:target>
>>>> <eip:faultsTarget>
>>>> <eip:exchange-target service="bescocr:myQueue"/>
>>>> </eip:faultsTarget>
>>>> </eip:pipeline>
>>>>
>>>> As intended when i get exception iam able to place the message in
>>>> myQueue
>>>>
>>>> But the message is like <stack>.....Complete stack trace...</stack>
>>>>
>>>> I want a message which is an actual Soap Fault message like
>>>> <Fault><FaultString></FaultString>...
>>>>
>>>> Am i doing any thing wrong while throwing exception? if so please help
>>>> me
>>>> out in creating proper AxisFault object(which should contain user
>>>> defined
>>>> error code,string and some extra info)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>
>
Re: Handling Faults in servicemix
Posted by Arif Mohd <ar...@wipro.com>.
Gert,
One thing i forgot to specify iam using a normal java class
file(MyService), this will call a business method on a handler class, the
handler class will inturn delegate the call to EJB's by using JNDI lookup
and MyService class is exposed as a POJO to JSR181
configuration for JSR181 is as follows
<jsr181:endpoint pojoClass="com.xxx.processor.MyService"
annotations="none"
service="demo:my-service"
endpoint="my-service" />
I tried by giving annotations="java5" and annotations="jsr181" but when iam
deploying the component it is giving the error saying
<loc-message>Class com.xxx.processor.MyService does not have a WebService a
nnotation</loc-message>
i have given the annotation as follows in the class MyService for one of the
method
@WebFault name="AxisFlt" faultName="org.apache.axis.AxisFault"
what is the change required in MyService class, it is a simple POJO which
delegates the call to a handler.
Gert Vanthienen wrote:
>
> Arif Mohd,
>
> Did you declare the AxisFault on your JSR-181 @WebMethod? Does the
> fault definition show up in your service's WSDL?
>
> Gert
>
> Arif Mohd wrote:
>> Hi,
>> Could any body tell me what am i doing wrong here?
>>
>> Arif Mohd wrote:
>>
>>> Hi,
>>>
>>> Iam using JSR181 component to expose an EJB method as a service and
>>> iam
>>> throwing an exception from EJB method as follows
>>> throw AxisFault.makeFault(ex);
>>>
>>> My component setup is
>>>
>>> ...... -->eip:tap-->eip:pipeline-->eip:tap-->...
>>>
>>> the xbean configuration for pipeline is
>>>
>>> <eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
>>> <eip:transformer>
>>> <eip:exchange-target service="demo:my-service" />
>>> </eip:transformer>
>>> <eip:target>
>>> <eip:exchange-target service="bescocr:myTap" />
>>> </eip:target>
>>> <eip:faultsTarget>
>>> <eip:exchange-target service="bescocr:myQueue"/>
>>> </eip:faultsTarget>
>>> </eip:pipeline>
>>>
>>> As intended when i get exception iam able to place the message in
>>> myQueue
>>>
>>> But the message is like <stack>.....Complete stack trace...</stack>
>>>
>>> I want a message which is an actual Soap Fault message like
>>> <Fault><FaultString></FaultString>...
>>>
>>> Am i doing any thing wrong while throwing exception? if so please help
>>> me
>>> out in creating proper AxisFault object(which should contain user
>>> defined
>>> error code,string and some extra info)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Handling-Faults-in-servicemix-tf4204826s12049.html#a11978058
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Handling Faults in servicemix
Posted by Gert Vanthienen <ge...@skynet.be>.
Arif Mohd,
Did you declare the AxisFault on your JSR-181 @WebMethod? Does the
fault definition show up in your service's WSDL?
Gert
Arif Mohd wrote:
> Hi,
> Could any body tell me what am i doing wrong here?
>
> Arif Mohd wrote:
>
>> Hi,
>>
>> Iam using JSR181 component to expose an EJB method as a service and iam
>> throwing an exception from EJB method as follows
>> throw AxisFault.makeFault(ex);
>>
>> My component setup is
>>
>> ...... -->eip:tap-->eip:pipeline-->eip:tap-->...
>>
>> the xbean configuration for pipeline is
>>
>> <eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
>> <eip:transformer>
>> <eip:exchange-target service="demo:my-service" />
>> </eip:transformer>
>> <eip:target>
>> <eip:exchange-target service="bescocr:myTap" />
>> </eip:target>
>> <eip:faultsTarget>
>> <eip:exchange-target service="bescocr:myQueue"/>
>> </eip:faultsTarget>
>> </eip:pipeline>
>>
>> As intended when i get exception iam able to place the message in myQueue
>>
>> But the message is like <stack>.....Complete stack trace...</stack>
>>
>> I want a message which is an actual Soap Fault message like
>> <Fault><FaultString></FaultString>...
>>
>> Am i doing any thing wrong while throwing exception? if so please help me
>> out in creating proper AxisFault object(which should contain user defined
>> error code,string and some extra info)
>>
>>
>>
>>
>>
>>
>>
>>
>
>
Re: Handling Faults in servicemix
Posted by Arif Mohd <ar...@wipro.com>.
Hi,
Could any body tell me what am i doing wrong here?
Arif Mohd wrote:
>
> Hi,
>
> Iam using JSR181 component to expose an EJB method as a service and iam
> throwing an exception from EJB method as follows
> throw AxisFault.makeFault(ex);
>
> My component setup is
>
> ...... -->eip:tap-->eip:pipeline-->eip:tap-->...
>
> the xbean configuration for pipeline is
>
> <eip:pipeline service="bescocr:pipeToPub" endpoint="endpoint">
> <eip:transformer>
> <eip:exchange-target service="demo:my-service" />
> </eip:transformer>
> <eip:target>
> <eip:exchange-target service="bescocr:myTap" />
> </eip:target>
> <eip:faultsTarget>
> <eip:exchange-target service="bescocr:myQueue"/>
> </eip:faultsTarget>
> </eip:pipeline>
>
> As intended when i get exception iam able to place the message in myQueue
>
> But the message is like <stack>.....Complete stack trace...</stack>
>
> I want a message which is an actual Soap Fault message like
> <Fault><FaultString></FaultString>...
>
> Am i doing any thing wrong while throwing exception? if so please help me
> out in creating proper AxisFault object(which should contain user defined
> error code,string and some extra info)
>
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Handling-Faults-in-servicemix-tf4204826s12049.html#a11977262
Sent from the ServiceMix - User mailing list archive at Nabble.com.