0

We have done integration from third party to salesforce, to be specific with Tibco. We have a webservice class in salesforce which is being invoked from Tibco and we send xml file with parameters.

For some parameters my webservice class fails.How can I send back error message from salesforce to Tibco.

2
  • Its too broad to answer. You will have to make changes to the Webservice class by handling the errors and send them the error in a mutually agreed format! Jan 6, 2015 at 7:19
  • Hey Amit thanks for suggestion. Will it be possible for you to provide some sample code regarding modifications in webservice class. Also i do not understand how exactly mutual agreed format be done.
    – Sara
    Jan 6, 2015 at 7:25

1 Answer 1

1

You have to set the parameter you return. For eg.
WebService static TestMethod (String x, String y, Date z) { if(x== '' || x== null)
{ RespSP.status= 'Failed'; RespSP.statusMessage ='X is missing'; return RespSP; } else if(y== '' || y== null)
{ RespSP.status= 'Failed'; RespSP.statusMessage ='y is missing'; return RespSP; } else if(z== null)
{ RespSP.status= 'Failed'; RespSP.statusMessage ='z is missing'; return RespSP; }

3
  • Thanks Shailesh. Just curious to know, how is that different from standard respinse salesforce would send back to calling party.
    – Sara
    Jan 6, 2015 at 7:49
  • In this case, we have used a wrapper class and defined separate responses for separate conditions customised. If you could post your code, I may suggest you a better answer. Thanks! Jan 6, 2015 at 8:55
  • Hey thanks, using your sample code I was able to write a good piece for myslf, i havnt chkd it yet. Appreciate ur help.
    – Sara
    Jan 8, 2015 at 8:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .