Skip to Content
author's profile photo Former Member
Former Member

Add attributes to an existing element

Hi everyone,

I want to integrate SAP TM with the third party via web service in order to determine the distance and duration for a shipment.

I generated the service consumer in SAP from the wsdl of the third party.


My operations are well created and I was able to call some of them and I had a response from the third party.


My problem is on a specific operation, where the element type is not defined in the wsdl.

I have to specify the type to call the service, but it's dynamic.

I have the choice between 3 types that I can use, and the responses from the third party is different, depending on which type I called.


Here is the xml generated by SAP :

<v1:ReportTypes>

<v1:ReportType/>

</v1:ReportTypes>

Here is the xml I need to build to call the service :

<v1:ReportTypes>

<v1:ReportType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="v1:DetailReportType"/>

</v1:ReportTypes>

My first guess is to use a transformation program and XSLT to transform the xml.

I already created an XSL that is doing what I want, but I don't know how or where to use is in SAP.

In fact, I don't even know if it's the right technical choice.

Do I have to use the already existing transformation programs associated with my ReportType object ?

or

Do I have to created a new transformation program using XSLT_TOOL transaction ?

or

Do I have to use ABAP ?

Is there anyone that could help me ?

Thanks a lot !


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 20, 2016 at 03:26 AM

    Hi Maxime,

    I am assuming that you are not using PI here. In generating an ABAP proxy by importing the WSDL, the same restrictions apply as if you are using an external definition and generating a proxy via PI Service Interfaces.

    Here is the xml I need to build to call the service :

    <v1:ReportTypes>

    <v1:ReportType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="v1:DetailReportType"/>

    </v1:ReportTypes>

    This request can be easily built using CL_HTTP_CLIENT.

    Regards,

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.