on 01-18-2010 11:00 AM
Hi
I have created a web service in Java using NWDS.
Which has a businessMethod which throws a Exception based on certain business logic.
I have consumed this Web Service Method using .NET Client.
i am able to catch the Exception and get the Exceltion Message.
But when i try to consume the same web service Method in ABAP,
i am not getting the Exception Message .
The Method call works fine.
What am i missing here ?
regards
Rajendra
awaiting answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I have defined a Custom Exception Class MyException which extends Exception Class.
and in the businessMethod i use this code
throw new MyException("This is a custom exception");
to throw the Exception.
As i wrote earlier,when i test this webservice from dotnet applciation,
i am able to catch the exception and get the exception message.
But not from ABAP.
Can you throw some light on this issue ?
Regards
Rajendra
Edited by: Rajendrakumar Gaikwad on Feb 9, 2010 6:53 AM
Hi,
Preferred approach is first to model service in ESR and assign "Fault Message" to operation and then use this wsdl in NWDS to create service.
Instead of using your own exception method please use SOAPFault exception, please see other standard services available on ABAP side to analyse standard SOAP fault message, you can extend this exception further.
ABAP will create object if it is similar or derived from standar fault message.
Regards,
Gourav
Hi,
>what is ESR got to do with this ?
If you model service in ESR and use wsdl generated from ESR to create service in CAF you will get all required methods and operation by default and they will be compatible with SAP approach.
Use "com.sap.caf.rt.exception.CAFServiceException"for all exception related to service. Fault is available as predefined type in CAF see following: http://help.sap.com/saphelp_nwce711/helpdata/en/43/78a5fd869b6fcbe10000000a1553f6/content.htm
Use exception only from above listing which will create proxy object of type "Fault" in ABAP as well.
Please Java Doc for CE for more detail: http://help.sap.com/javadocs/nwce/ce71/caf/index.html
Regards,
Gourav
Hi,
In such case use NWDS 7.1 (doesn't matter if you don't have CE 7.1 or not). You will get all required java library and then you can build service with CAFexception.
Just make sure all necessary library also deployed along with service.
I assume you have ECC 6.0 on ABAP side?
Another method is just to deploy necessary libaray in NWSD to make it work or do not raise exception but return empty body with message and handle excpetion internally in the service.
Regards,
Gourav
not solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Upon further investigation and comparison of the custom exception object (generated during consumer proxy creation for a CUSTOM web service) with a standard exception object(generated during consumer proxy creation for a STANDARD web service) I found that the sub-elements of the exception structure errorPart are not available in the custom exception object (and one of these sub-elements is the message text).
Call Stack,ExceptionName and MessageText Elements are missing in the errorPart node of Exception
Node. as seen in the ABAP Exception structure generated.
Queries:
1. Are there any standards which need to be followed when coding exceptions in the Java web service for consumption in ABAP such that all sub-elements of the exception object are also created in ABAP during the proxy creation?
2. Can we get the Java code for a standard web service available in SAP Netweaver? Asking the same as the exception object created for the standard web service RoomABAPWS contains the sub-elements. Getting the Java code of the same will be very helpful in resolving the issue.
Regards
Rajendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.