cancel
Showing results for 
Search instead for 
Did you mean: 

Cloud HTTP Destination for External Webservice

fahad_saplearning
Participant
0 Kudos

Hello All,

I wanted to execute a webservice hosted in w3schools using SAPUI5 application and WebIDE.

WSDL url is: W3Schools Webservice

When I used the url directly in UI5 code, I got error on "access control allow origin" as the url belongs to different domain.

So I have decided to create a http destination for the WSDL, refer the alias in neo-ap.json and make use of that alias in Web IDE code.

So, I have created the following HTTP destination in Cloud platform cockpit

neo-app.json

{
"path": "/w3schools",
"target": {
"type": "destination",
"name": "w3schools",
"entryPath": "/"
},
"description": "W3SChools WS Temperature Conversion API"
}

In my controller, I have referred the destination during ajax call as follows:

url: "/w3schools/xml/tempconvert.asmx?WSDL",

However, it seems unreachable to the code as I can see this invocation with red status in the "Network" tab of google chrome!!

To cross check, I tried to open the destination using the application testurl with suffix /w3schools/xml/tempconvert.asmx?WSDL

With this, I came to the conclusion that the issue is with the HTTP destination configured in cloud cockpit.

I have tried various options (url as https://www.w3schools.com instead of http), giving different name is WebIDESystem, etc but nothing worked out in my favor.In all these cases, the destination is in green status when I tried wih "Check Connection" option of HTTP destination.

Can someone please tell me how to resolve this? Here, I would like to stick with the HTTP destination approach as it gives me the flexibility to configure the service from an admin perspective, so in turn easier maintenance.

Regards,
Faddy

Accepted Solutions (1)

Accepted Solutions (1)

Hi,

where did you create the Destination? On Connectivity->Destinations or on SAP WebIDE level?

I've tried the exact same scenario and it worked out for me:

1) Creating Destination: Connectivity->Destinations

2) Add Destination entrypoint to neo-app.json

{
      "path": "/w3schools",
      "target": {
        "type": "destination",
        "name": "w3schools",
        "entryPath" : "/"
      },
      "description": "w3schools Destination"
    }

3) Make Call in UI5 App

var url = "/w3schools/xml/tempconvert.asmx?WSDL";
$.ajax({
	type : 'GET',
	url: url
});

Maybe you can double check where you've created the Destination, check that you try to access the url https://www.w3schools.com/ and make sure that the naming is correct.

Hope that helps.

Best regards

Daniel

fahad_saplearning
Participant
0 Kudos

Hello Daniel,

Thanks for your response.

I have created the destination in the same way as you have done under Connectivity -> Destinations of the Cockpit.

Here the culprit was: WebIDESystem which I have mentioned in the destination (you can see it in the screenshot). When I removed that (by following your screenshot), it worked for me. 🙂

In order to conclude on the solution, I would like to as you that: What is the purpose of WebIDESystem while creating HTTP destination? And what value should we mention there if it's

1. Onpremise oData service

2. An onpremise WebService

3. An External oData service

3. An external service (say REST service or a webservice)

Regards,

Faddy

0 Kudos

Hi Faddy,

Actually I've never had troubles with setting the attribute WebIDESystem. The WebIDESystem Attribute can be used for adding a SAP System ID - just as kind of description. In case you are interested in further WebIDE related attributes, you might like take a look here https://help.hana.ondemand.com/webide/frameset.htm?5c3debce758a470e8342161457fd6f70.html

When working with OData Services, you can add the WebIDEUsage attributes. For example if you want to create a Destination pointing to your Gateway System, just add the Attribute WebIDEUsage : odata_abap

For all other OData Servies (e.g. Northwind), take a look here: https://www.sap.com/developer/tutorials/hcp-create-destination.html

For any REST or WebService you just have to define, if the service is reachable from the Internet or should be taken from the Cloud Connector connection (OnPremise) - all other properties have the same properties as our w3schools example. Destinations are actually just pointing to your desired hostname and maybe some path (like www.sap.com/api/ or so) and forwarding your requests to the particular server - that's basically it 🙂

Best regards
Daniel

Answers (1)

Answers (1)

fahad_saplearning
Participant
0 Kudos

Can someone please help here? I would like to know how to configure HTTP destination for external webservices in Cloud cockpit and use it in WebIDE?