cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an ABAP SOAP Webservice

ArthurParisius
Contributor
0 Kudos

Can anyone point me to some instructions on how to create an ABAP WebService that uses a SOAP envelope, we will not be using PI. I have a WSDL and found instructions on how to create a Service Consumer using this WSDL. However when I look at what SAP creates from that WSDL, the SOAP envelope (Header and Body) part is no where in sight.

If anyone can point me to some instructions on how to do this I would greatly appreciate it. The more detailed the description the better as this is the first time for me creating a WebService.

Thanks in advance,

Arthur

Accepted Solutions (1)

Accepted Solutions (1)

matt
Active Contributor
0 Kudos

Your question is not clear. Are you wanting to consume a webservice, or create one for others to consume?

You say you have a WSDL. From where?

Given a WSDL for a web service, SAP creates a consumer proxy, so that you can consume the webservice from ABAP. You don't need to get involved with SOAP details, you just instantiate the proxy class and call the appropriate methods.

ArthurParisius
Contributor
0 Kudos

I need to use the Webservice from an external party and received the WSDL from them. I created the consumer according to this blog. Concerning the SOAP details. I received an example test file from that which included the SOAP details See part below. The Filestream part would be a base64 string containing a different XML.
The SOAP would contain the file name and reference data to inform the receiving party where the data came from. All this leads me to believe I do need to look at the SOAP details.

The consumer proxy generated by SAP only contains the stuff needed for the BestandsInfo part.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:BestandsFormaat xmlns:h="http://tempuri.org/">xml</h:BestandsFormaat>
    <h:BestandsNaam xmlns:h="http://tempuri.org/">testbestand.xml</h:BestandsNaam>
    <h:BestandsSoort xmlns:h="http://tempuri.org/">xml</h:BestandsSoort>
    <h:Beveiligd xmlns:h="http://tempuri.org/">true</h:Beveiligd>
    <h:DatumTijd xmlns:h="http://tempuri.org/">2017-07-03T15:59:39.873+02:00</h:DatumTijd>
    <h:ReferentieCode xmlns:h="http://tempuri.org/">refcode1234</h:ReferentieCode>
    <h:ReferentieKey xmlns:h="http://tempuri.org/">
       0bfe15ad51bf1052072611afeb64516caf9c7a55
    </h:ReferentieKey>
  </s:Header>
  <s:Body>
    <BestandsInfo xmlns="http://tempuri.org/">
      <FileStream></FileStream>
    </BestandsInfo>
  </s:Body>
</s:Envelope>

matt
Active Contributor
0 Kudos

Please use the "code" button when posting code/xml etc. I've done it for you this time.

Look at the proxy class. What parameters does it have? What is the structure of those parameters? Do they not somewhere include a spot for the filestream information?

matt
Active Contributor
0 Kudos

Well, it's certainly the case, in my experience, that not all configurations of SOAP webservices are consumable from ABAP. In the past, I've had to simplify the WSDL to get the functionality to work.

Even then, sometimes I've had to go to support.sap.com for assistance. The problem is that the solution for SOAP provided by SAP is abstracted quite a distance from the SOAP structures.

Since you do have CL_HTTP_REQUEST, CL_HTTP_RESPONSE etc. classes available, worst case you could program the calls yourself at that level.

My advice is to go to support.sap.com for assistance first. They've been quite helpful to me in this area.

ArthurParisius
Contributor
0 Kudos

Thanks for the info. I'll follow your advice and go to support.sap.com for assistance.

Answers (2)

Answers (2)

NTeunckens
Active Contributor
0 Kudos

For general Resources on this : Check SAP-Wiki "ABAP Connectivity - Web Services ABAP" : link (See the 'Configuration' Category)

See the Guided Answer SAP-KBA 2553979 : link

You might want / need to change the NameSpace that is generated by Default "tempuri.org" to a NameSpace associated with the Service Provider ...

ArthurParisius
Contributor
0 Kudos

Thanks for the link.

It provides a lot of information but I'm still missing on how to use the SOAP header and providing it with values. I'll admit I haven't looked through everything yet, but none of the links look like they'll mention anything about using the header from ABAP.

Regards,

Arthur

matt
Active Contributor
0 Kudos

Look at the generated ABAP proxy class. What parameters does it have? What is the structure of those parameters? Do they not somewhere include a spot for the filestream information?

ArthurParisius
Contributor
0 Kudos

Hi Matthew,

The proxy class does have a spot for the filestream information. The part I'm missing is for the SOAP Header. The header needs a parameter which contains the filename of the file that's placed in the filestream part. This is needed since part of the filename contains a timestamp.

matt
Active Contributor
0 Kudos

I've put my response under my answer.

Jelena
Active Contributor
0 Kudos

If I understood the question correctly, Google -> "consume web service from ABAP" -> finds very many SCN blogs and even YouTube videos. This blog is just one of the top links. Some steps might look slightly different, depending on the release, but in a nutshell it's the same process.

I'm a bit confused by the SOAP envelope part though - have you tried these steps and ran into a specific issue? As Matthew correctly noted, there shouldn't be a need to even look at this.