cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:Consume SOAP webservice in SAPUI5

former_member222013
Participant
0 Kudos

Hi,

I am trying to consume a sample webservice(Celsisus to Fharenheit Converter) in SAPUI5... Can anyone please help me on providing/explaining  --------- How to Consume a webservice in SAPUI5 -- Without using ODATA ??

Please provide a document/Step by step process to acheive this.

Thanks,

NWUser

Accepted Solutions (0)

Answers (2)

Answers (2)

vishnucta
Active Participant
0 Kudos

I am getting below mentioned error while executing it.Cross domain issue since my UI5 tries to access the domain from my local runtime.

Regards,

Vishnu

ashish_sharma1
Explorer
0 Kudos

Hello Vishnu,

Were you able to solve this problem?

I am also facing the same issue.

Thanks in advance.

Ashish

former_member197827
Participant
0 Kudos

Hi Vishnu,

Disable web security and try...

For chrome use following procedure....

Close all chrome windows...

Press windows+R(to open Run prompt)

Then type following command in it

Chrome --d -disable-web-security

Then press enter button..

Now chrome window will open with security disabled mode..... Now ur service works without cross domain issue...

Regards,

Sagar M Patil

Former Member
0 Kudos

Hello Vishnu,

Try sending the XCSRF token in the header of the SOAP request. This token will be generated by the respective backend server. to fetch the XCSRF token refer this thread How to fetch X-CSRF-Token | SCN

Former Member
0 Kudos

Hi,

Please use below mentioned Ajax call to consume web service -

var soapMessage = '<?xml version="1.0" encoding="utf-8"?>'

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

                                 + '<SOAP-ENV:Body>'

                                 + '</yq1:helloWorld4>'

                                 + '</SOAP-ENV:Body>'

                                 + '</SOAP-ENV:Envelope>' ;

                                           $.ajax({

                                                            url : url,

                                                            type : "POST",

                                                            dataType : "xml",

                                                            data : soapMessage,

                                                            contentType : "text/xml; charset=\"utf-8\"",

                                                            success : function(data, textStatus, jqXHR) {

                                                                      console.log("data"+data);

                                                            },

                                           error: function()

                                           {

                                                     console.log("ERROR");

                                           }

                     

                                           });

you can call a rest service by changing the soapMessage object to a json object (according to your service).

Regards

former_member222013
Participant
0 Kudos

Hi Jeetendra,

Actually I am a newbie to SAPUI5... Can you please explain in detail about this ... I understood the above mentioned method in parts which I am not confident to make a try.

Can you please elaborate clearly and step by step ..

Thanks for your support.

Former Member
0 Kudos

Hi,

Please find the below mentioned tutorial -

  1. http://www.codeproject.com/Articles/60222/4-Steps-to-Consume-Web-Services-using-Ajax-Include
  2. http://stackoverflow.com/questions/13449255/ajax-call-web-services

First one is very detailed step by step explanation. This should be get you going.

Good Luck

Jeet

former_member187227
Participant
0 Kudos

This message was moderated.