Skip to Content
avatar image
Former Member

Reg:Consume SOAP webservice in SAPUI5

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 26, 2013 at 07:05 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2014 at 01:57 PM

    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


    Add comment
    10|10000 characters needed characters exceeded