on 02-07-2019 12:54 PM
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?
How we do this is the following:
This way it effectively calls out to the same URL, with the same login details, as the inbound counterpart --- allowing the call to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
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,
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
User | Count |
---|---|
82 | |
11 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.