cancel
Showing results for 
Search instead for 
Did you mean: 

Call a Web Service passing an XML file

Former Member
0 Kudos

Hi all,

I'm a newbie regarding the web service creation and use. I have created in BW (release 7) a data source with "WEB SERVICE" source system. Then, I tested this web service (inserting manually the values to load and launching the test).

I see that data is loaded in PSA but the request is ever yellow (message is "Current status

No Idocs arrived from the source system."). Now I am waiting 1 hour (the setting on the infopackage for the automatic closure of the request), I hope this is the reason of the yellow request. Is it not possible to close this request immediately?

Another question is: if I have an XML file that contains data to be sent, how can I call the web service passing this XML file?

Thanks a lot for the support,

Gianluca

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You need to send the data in a SOAP request, i think that is better you generate a proxy to your Web Service. or you can build manually your SOAP envelop and send the data of your XML, but the XML must contains the exact structure of your Web Service.

To make it i suggest you to see a document about SOAP Protocol. http://www.w3schools.com/soap/default.asp

Best regards

Answers (4)

Answers (4)

Former Member
0 Kudos

No idea? I don't know if it is necessary to create a proxy (but now I cannot create proxy on my system, so I cannot verify..).

Thanks,

Gianluca

Former Member
0 Kudos

hi Anton,

+for sending an XML payload just base64 encode the XML like payload('make it binary') and put it into an ordinary request tag. decode it on reception at the service side using e.g. CL_ABAP_CONV .+*

I don't understand the step "put it into an ordinary request tag". What I've done now is to write the structure of the XML file:

<?xml version="1.0" encoding="UTF-8" ?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Header>

...

</SOAP-ENV:Header>

<SOAP-ENV:Body>

....

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Now, I have this file on my local pc. For calling the web service passing this file, do I need a software or somehow similar?

Thanks for the support!

Gianluca

Former Member
0 Kudos

hi Gianluca,

I am sorry I don't really understand what the state of your know-how is.

are you asking how to basically use a webservice? don't you have any webservice client programme in use yet? ...

usually, you don't build a SOAP file manually but have some development environment (language) where you

- instantiate a client class based on the webservice's WSDL (description)

- feed it some input parameters using setter methods

- execute a service call method

- parse the feedback

what I understood (and answered) earlier was the situation where one of your parameter itself is an 'XML value'. E.g. instead of

<input>some_input text</input>

you want to transmit

<input><xml><name>some name</name></xml></input>

which would be rejected in the first place by the webservice runtime because the whole resulting SOAP message would be an XML not conforming to the WSDL anymore.

you can avoid this rejection by encoding the content(the XML content of that one parameter). This would result in something like

<input>A45EFD67AA1BAD3</input>

That's what I tried to answer.

If you don't know how to submit the content to the webservice at all, you better search SDN for some examples on how to do that using .net, PHP, Ruby, Java, whatever..

regards, anton

Former Member
0 Kudos

Hi Cristiano,

thanks a lot for your reply. I built an XML file with the right structure. But I don't know how to call the web service passing this file. Is it necessary to write abap code that takes in input this file and calls some function modules?

Regards,

Gianluca

Former Member
0 Kudos

Hi,

I don't know the ABAP, but with Java we must to create a soap envelop with the XML as payload. To ABAP I think that you can try the tip posted by Anton on last post.

Another option would, create a proxy to Web Service and parse the XML, after set parameters of service call.

How to consume Web Service with ABAP : https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30f1b585-0a01-0010-3d96-ad0ea291...

Best regards

Former Member
0 Kudos

hi,

for sending an XML payload just base64 encode the XML like payload('make it binary') and put it into an ordinary request tag. decode it on reception at the service side using e.g. CL_ABAP_CONV* .

regards, anton