Adding fault message in web services

Posted by dnessapkota10 on 17-Apr-2012 01:16

I have sucessfully added fault message in web services using content based routing rules. This rules will execute when the input parameter is invalid. But I am not getting error message with invalid input value.

I also attached my project. Please find the attachement.

What could be the solution?

Thank you,

Dinesh

CreateTopDownWS.rar.zip

All Replies

Posted by wtam on 18-Apr-2012 02:18

You need to set the Fault Name field (see screenshot).  Also prior 8.5, Fault Name needs to match a Fault Name defined in your WSDL.  So, If you are running 8.0.x, you need to define Fault in your WSDL, too.

Cheers.

Posted by dnessapkota10 on 18-Apr-2012 04:45

Hi William,

As you said, I have added the fault message in WSDL file with the same name i.e. ERR but it is still not working. Please find the attachment.

Any solution?

Posted by dballa on 18-Apr-2012 07:17

Hi Dinesh,

Please try the below steps

Returning a SOAP fault

When you expose an ESB process, you might need to return a SOAP fault in a particular scenario. To do this, define a  Fault (for example, Fault0) on the Interface page of  the ESB process. For each fault, add a fault part (for example, Param1). This definition of  fault will be written to  the generated WSDL file. It is recommended that you describe the structure of  the fault in an XSD file  and set the type of the fault accordingly. You must also set the Input and  the Output parameters on the Interface page.

In the ESB process definition, you need to define a decision logic (for  example, CBR) to decide when to return a SOAP fault.

To returnSOAP fault:

  1. Add a Fault step at the end of the branch from which a SOAP fault must be returned.

  2. Set the SonicESB.Fault.Name ESB message  header. The value for the header must be same as the fault name defined on the Interface page. You can  also set the Error Name runtime  parameter of the Fault step. If the header is not set, the SOAP fault detail will not be  generated.

  3. Set the message part with the same name as defined for the fault part on the Interface page  (for example, Param1). This will be used as the SOAP fault detail.

  4. Set the SonicESB.Fault.String ESB  message header. The value of the header will be the fault string of the SOAP fault. You can also set the Error Message runtime parameter of the Fault step.

  5. Set the SonicESB.Fault.Code ESB  message header. The value of the header will be the fault code of the SOAP fault. You can also set the Error Code runtime parameter of the Fault step.

Posted by dnessapkota10 on 23-Apr-2012 01:15

Hi Deepthi,

I am newbie of sonic workbench. I had tried some of the steps to add the fault message in the wsdl file as well as interface tab of esb process but still unable to get the fault message while input is not valid.

I have attached my project. Can you please modify my project and let me know where I made a mistake?

Thank you,

Dinesh

Posted by wtam on 26-Apr-2012 23:07

It looks like your WSDL is missing "fault" in binding operation.


 

     ...

    
       
    


 

This thread is closed