2023 Sep 04 8:50 AM
Dear Guru's,
I'm currently working on an S4 implementation, for interfaces we are looking into setting up a SOAP call with a third party.
Before I only used proxy objects from PI/PO or oData calls to BTP. So a direct SOAP call from S4 is new to me.
I have received a WSDL and created an enterprise service with a deeply nested structure with this URL.
Which gives me in fact 2 classes:
- Service Consumer class, this has the internal and external view with the deeply nested structures
- Proxy class, this has the methods and should be used in ABAP
After this I used transaction SOAMANAGER to create a logical port.
After this setup I tested the Service consumer class and I can see my port and method:
when I then send the dummy data via xml I get a response:
it is an error, but that is normal, It only shows that the connection is working.
there is another story when I create an ABAP program and try the same:
ls_file_to_doc contains a deep structure with the same dummy data as in the XML.
But the CX_AI_SYSTEM_FAULT is always triggered with the following message:
CX_PROXY_ST_INVALID_DATA:XSLT exception.The exception CX_PROXY_ST_INVALID_DATA was raised within the method call of the include /1SAI/SAS9308BCEEDAF4010F26CF in /1SAI/SAS9308BCEEDAF4010F26CF in line 156..Value is invalid for selection at ''
it always seem to fail at this line, when ABAP tries to serialize the body of the SOAP call.
Any help is welcome!
2023 Sep 04 8:54 AM
PS: For testing purposes I also created a service based on another SOAP call with a WSDL to have a simple calculator, and this works perfectly fine.
2023 Sep 04 9:17 AM
What do you see when showing the exception text?
CATCH CX_AI_SYSTEM_FAULT INTO DATA(r_ai_system_fault).
WRITE r_ai_system_fault->get_text( ) TYPE 'I'.
Have you filled the correct/mandatory import parameter before calling the web service?
Did you try to call the web service with SoapUI etc.?
2024 May 29 12:51 PM - edited 2024 May 29 12:57 PM
I had the same Issue. Check if some WSDL Type definitions relevant for your input structure use choice-Tags. The SAP Proxy generates special "Choice-Structures" with an obligatory field named "SELECTION" where you need to identify the choice. Otherwise the transformation throws an CX_PROXY_ST_INVALID_DATA exception.
Example:
DATA ls_choice TYPE Z_GENERATED_EXAMPLE_CHOICE_STRUCTURE.
ls_choice-selection= 'EXAMPLE_CHOICE_A'. " Generated Standard field
ls_choice-example_choice_a = 'Some value'. " choice to be filled
" ls_choice-example_choice_b must not be filled