cancel
Showing results for 
Search instead for 
Did you mean: 

error messages of sap based web service provider

dirk_hennebeil
Discoverer
0 Kudos

Moin,

we have a web service provider generated from a function module. It works, It's synchronous. There is no XI/PI, just the 740 application server.

If the provider is called with a bad request, e.g. a date field is not filled correctly, the system throws CX_SY_CONVERSION_NO_DATE_TIME. So far, so good.

But the response of the web service has

a) http/500 internal server error. I would expect http/400 bad request

b) SRT_UTIL shows a correct error text: "Value ? is not a valid date in accord with the XML format for ABAP". But the response says only "Web service processing error; more details in the web service error log on provider side". Very useless for the consumer to create a correct request.

Is there any way to extend the response with the helpfull error text?

Thanks, Dirk

Accepted Solutions (0)

Answers (2)

Answers (2)

naresh_kabar
Explorer
0 Kudos

Hi Dirk,

Pass value below mentioned format in web service

yyyy-MM-ddTHH:mm:ss.fffffffzzzzzz is the expected format.

e
.g. 2014-02-01T00:00:00.0 or

     2014-02-01

Regards

Naresh.

dirk_hennebeil
Discoverer
0 Kudos

Hi Naresh,

wrong date format is just an example for bad requests. We want the web service provider to send a helpfull error text in the response of the synchronous web service.

iaki_vila
Active Contributor
0 Kudos

Hi Dirk,

You can catch the exception:


DATA: exc TYPE REF TO cx_ai_system_fault.

TRY.
       CALL METHOD proxy->myproxy
         EXPORTING
           output = ..
         IMPORTING
           input  = ...
     CATCH cx_ai_system_fault INTO exc.
   error_text = exc->get_text( ).
     CATCH cx_ai_application_fault.
   error_text = exc->get_text( ).
   ENDTRY.


However the information is not clear for a final user.

Like ABAP developer you should try to do some validations before the call to avoid this errors and to inform to the client with a clear information.


Regards.

dirk_hennebeil
Discoverer
0 Kudos

thanks for your help, but the consumer is SOAP not ABAP and does not have access to SRT_UTIL. We just want to have the SRT_UTIL error text in the response.