cancel
Showing results for 
Search instead for 
Did you mean: 

is there a way to get the response of a web service from DS

former_member220449
Participant
0 Kudos

Hello,

I have a HR dashboard on which I want to show employee photos.

Normally, in HR ecc system HRWPC_RFC_EP_READ_PHOTO_URI function is used to get URL of the picture.

I can run this function from DS side via a web service; but how can I get the response of the web service?


I hope I'm clear.



Thanks.


Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Coskun,

At the moment I think your main option would be to write a custom component using the Design Studio SDK to interact with the web service.

Regards,

Mustafa.

former_member220449
Participant
0 Kudos

Thanks Mustafa for answer.

We can count this as correct answer.

I need to make some research for using SDK, then new questions will arise

former_member220449
Participant
0 Kudos

The component needs to run as algorithme below:

-Access to web service with the given EmployeeId parameter

-Return the result of the web service (it's a simple url as text data) to a variable.

-This variable will be used as image source url

So now the question is; how can I do this with SDK 

former_member183473
Participant
0 Kudos

Hi Coskun,

To call a webservice from you SDK code, you will use this function


$.ajax({
  type
: "POST",
  url
: "MyWebService.asmx/SayHello",
  data
: "firstName=Aidy&lastName=F", // the data in form-encoded format, ie as it would appear on a querystring
  dataType
: "text", // the data type we want back, so text. The data will come wrapped in xml
  success
: function (data) {
  $
("#searchresultsA").html(data); // show the string that was returned, this will be the data inside the xml wrapper
  
}
  
});

This is just a simple example of how you call the webservice from javascript, which is the programming language you will be using to code your SDK, you should look into the $.ajax function to find exacly what you are looking for.

Let me know if you need further help.

Best

Leandro

former_member220449
Participant
0 Kudos

Thanks Leandro, it will help me a lot.

I'll try and let you know.

Former Member
0 Kudos

When you define an SDK Component that makes an AJAX call is the call ultimately made from the Client or the Server?  If server side, does it enforce any kind of cross domain restrictions?

Former Member
0 Kudos

Hi Coskun,

With the current limitations of DS, you can follow below steps to achieve your objective. This offcourse is valid only if you don't want to use the SDK option...

  1. Create a datasource in HR ecc system which returns the Employee URL based on input Employee key using the referred function module. (Yes, I know its an ABAP development)
  2. Create a Virtual provider in BW which uses this datasource , create a BEx query which provides the URL as result value using Employee key as Input variable.
  3. Use this query in DS and get the URL against the respective Employee ID.
  4. Next challenge is, how to read this value in DS as it doesn't provide any option to read characteristics values. A workaround way is to move the DS Datasource results to a single selection Listbox using setItems method. The first row (and the only row in this case) is set as default selection in Listbox. You can read this value using List box get selection method.
  5. Assign the return value to Image URL.

The method is long but the evils are known

The Listbox read method can be used also in case if you want to read some other characteristic values of the Employee and capture results in any text element.

Hope this helps,

Regards

former_member183473
Participant
0 Kudos

Micahel,

I didn't think about that.. good point.

I only used that to call the server itself, since I created a java weservice and deployed it to the Business Objects Tomcat.

Being crossdomain, I don't think it's a valid solution.

Best

Leandro

former_member183473
Participant
0 Kudos

I'd definitely go with this solution.

Creating a javascript program that calls another server, will be very hard.

Best

Leandro

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Coskun,

did you already consider consuming the Web Service through a Universe?

Best regards,

Victor

former_member220449
Participant
0 Kudos

Thanks for your suggestions, I appreciate a lot Sdn community.

@Anil: Url text that HR ecc is generating is more than 400 characters because it has security key inside. I don't know how it's possible to use Bw in this case The maximum size for text in Bw is about 60 characters as I know. I can ask to HR module specialist to create the url shorter maybe.

@Victor: This method can work also, I will try and let you know.

Regards,

Coskun.

Former Member
0 Kudos

Hi Coskun,

Generally there will be a fixed prefix of URL which shouldn't change for every employee. You can keep this portion hardcoded in DS.

Even after this if the URL length is more that 60 characters, you can split the values and move the result into multiple info objects and then concatenate results in DS. (Just to add, this restriction of 60 char is now no more valid in BW 7.4 as I understand, but need to confirm)

But if your are able to consume the web service in an Universe, and get the URL as a result value, this option is much preferable than getting this worked in BW.

Reading the values will however may require the same method as mentioned in items 4 & 5.

Please keep your results posted.

Regards,