cancel
Showing results for 
Search instead for 
Did you mean: 

Call the web service ManageExchangeRateIn from the studio

leveau1
Explorer
0 Kudos

I have created a solution in Cloud Application Studio where i want to fetch exchange rates from an external web service using Outbound Communication and then add those exchange rates to ByD. Since the BO ExchangeRates isn't part of the PSM i have to use the web service ManageExchangeRateIn. I had no problems adding the external web service, there is no authentication, but i do have huge problems adding the "internal" one.

First i tried adding both the internal and external webservice in the same communication scenario. The external as Outbound Communication and the internal as Inbound Communication. This made the most sense. However, by doing this i'm not able to create the fields in the absl script for the ManageExchangeRateIn web service as there is no Library for it. Maybe there is some other way to do this but i couldn't find how.

The second approach was to add ManageExchangeRateIn the same way as the external web service in the first apporach, by adding the wsdl file. So i created a new communication scenario where ManageExchangeRateIn is set to Outbound Communication and the authentication user the same as my studio user. Now i'm able to create the fields in the absl script for the web service BUT, the authentication doesn't work. When i run the debugger and execute the web service i get this response "SOAP:1.048 SRT: HTTP error:(HTTP Code 401: Unauthorized - Details see in error log of transaction SRTUTIL")"

Both wsdl:s worked when i tried them in SoapUI.

So my question is, is there a way to either set up web service authentication in the studio or is there some kind of library for internal web services which i could use to add the data from external services?

Hanumath
Participant
0 Kudos

Hi Pierre ,

Have you created the inbound communication arrangement for the service Manage Exchange Rate In?

if not please try to create an inbound communication arrangement for the service and try to push the values in, you will be seeing the request going through successfully.

Regards

Hanu

leveau1
Explorer
0 Kudos

HI Hanumath.

Yes i have created the inbound communication (see attached file) but i don't know how to call for it in the absl script.

For the outbound communication i just import the wsdl file into the studio and call the functions by using Library::nameofservice.wsid.function. This can't be done for the inbound, hence why i created ManageExchangeRateIn as an outbound communication too. Now i can call the functions but i get authentication errors.

.

View Entire Topic
former_member183363
Active Contributor

How we do this is the following:

  1. Download the standard ByDesign inbound webservice (or custom one, if it's created in the studio).
  2. Use that WSDL file to create an external integration (WSID) file in the solution.
  3. Create a communication scenario (CSD) file, and tick both the standard (or custom) inbound service and also the custom external one (the WSID file).
  4. Create a communication arrangement in ByDesign using that communication scenario. Create a password for the inbound user, and create a username/password for the outbound user that is identical to the details for the inbound one. In the advanced technical options, copy everything after the 'sapybydesign.com/' in the inbound URL into the 'path' box of the outbound service, such that the two URLs are the same.

This way it effectively calls out to the same URL, with the same login details, as the inbound counterpart --- allowing the call to work.

fceylan_hs
Participant
0 Kudos

Could you provide some absl code about how to communicate those web services with eachother?

leveau1
Explorer

Hi Fatih,

In the Studio documentation you will find a chapter about creating external web service integrations. Use the example code provided and then you just have to parse and map the data.

Ex.

import ABSL;
// Communication details var ScenarioName = "GetCity"; var ServiceName = "GetCityByPostalCode"; var HttpMethod = "GET"; var HttpResource = ""; // not required for this example var ContentType = ""; // not required for this example var Body = ""; // not required for this example var HeaderParameter : collectionof NameAndValue; // not required for this example

// Set URL Parameter var URLParameter : collectionof NameAndValue; var URLParameterEntry : NameAndValue; URLParameterEntry.Name = "country"; URLParameterEntry.Value = this.CountryCode; URLParameter.Add(URLParameterEntry); URLParameterEntry.Name = "postalcode"; URLParameterEntry.Value = this.PostalCode; URLParameter.Add(URLParameterEntry); URLParameterEntry.Name = "username"; URLParameterEntry.Value = // Add your user name; URLParameter.Add(URLParameterEntry);

// Execute webservice call
var ws_result = WebServiceUtilities.ExecuteRESTService(ScenarioName, ServiceName, HttpMethod, HttpResource, URLParameter, HeaderParameter, ContentType, Body);
fceylan_hs
Participant

Hi leveau,

Thanks for reply. As you described, I followed the documantation and guidelines. I'm kinda figured out how to implement Web Services. Although I still struggle some authorization/authentication problems but eventually I'll find how it should work. And willing to share my experience with others when I'm done 🙂

Best Regards,

fceylan_hs
Participant
0 Kudos

I've got problem on step 3. When i select both(inbound and outbound) communication scenario and click next, sdk shuts down without any error. Tried many things including reinstall sdk but still got this problem. Does anybody has similar issues?

Edit: Found solution here; https://userapps.support.sap.com/sap/support/knowledge/en/2830141