Is there any way to send a filter/parameter in Client OperationMode? - odata

Hello Stackoverflow Community,
i developed an abap program that displays roles in a tree output and now want to create a ui5 application with the same functionality. For this, i created an OData Service where the GET-Method simulates my abap program via a SUBMIT-Call and returns the output tree after then displays it using a TreeTable.
Now the problem: I am using OperationMode "Client" for my OData Service so filtering is done on the client side. My backend program needs parameters to function though. Is there a way to pass any arguments to my GET-Method while using OperationMode "Client"?
I have tried the bindRows() approach where u pass filters but this only works in "Server" OperationMode. Sadly i cant use "Server" OperationMode because it would result in having to simulate my abap program everytime the user expands a TreeTable-Node, rendering my program unuseable because of performance issues.
Hoping someone can help me on this issue and looking forward to your answers!

Solved this issue by sending a request in "Server"-Mode, saving the odata response to a json model and then binding said model to my treetable with "Client" operationmode.

Related

OData in Datafactory

I have a task toget some data from an external supplier.
They have a Rest OData API. I have to connect using a subscription-key(APIKey).
When creating the OData LService, I add an Auth Header: "subscription-key" and in the Value field, I enter my key. After saving, I create a new dataset, and the OData LinkedService, provides me with the remote tables. I can choose the table I want and after that I create a pipeline to copy data from that table to my Azure SQL server.
This works fantastic :-)
However, after closing my browser and re-open it, the subscription key that I have entered earlier on the linked service, is now replaced with stars as it is a securestring. When I now run my pipeline, it will think that my key is the ten stars that have replaced my real key.
What am I doing wrong here ?
Also I would prefer to get my value from the KeyVault, but it seems that this is not possible on ODat connections....
Hope someone is able to provide some insight here :-)
BR Tom
From my testing I did not get any error on re-running. However coming to dynamic keys - I was not able to achieve it using the ODATA linked service.
Alternatively, if you can hit the ODATA endpoint with REST / HTTP Connector
You could - have a Web Activity to get the keys from the Key Vault and Set in the Variable.
WEB Activity URL : https://<your-keyvalut-name>.vault.azure.net/secrets/<your-secret-name>;
You could access the output of the web Activity using : #activity('Web1').output.value & Store in a variable.
You can reference this variable as the SUBSCRIPTION KEY for the subsequent steps in the REST/HTTP dataset.
You could pass it along the additional headers

How to access a two levels deep nested association of an OData V2 service?

I have exposed an OData V2 Service via the ABAP Service Gateway (SEGW) based on a CDS View. The view contains indirect associations to two other views (entity_1 > entity_2 > entity_3 - no direct connection between entity_1 and entity_3). My problem is that I can't access entity_3 from entity_1 via entity_2. Accessing entity_2 works just fine by using /service_name/entity_1?$expand=to_entity_2 but after that I can't dive any deeper. I tried using /service_name/entity_1?expand=to_entity_2($expand=to_entity_3) but as soon as I put a second query in parenthesis after the first one I receive an error message.
Do I use a wrong syntax or are these nested calls not supported by OData V2? And if it's not supported how do I solve my problem? The service is used in a SAPUI5 application where it should be bound against a tree table so I need (three) different levels in my service.
Apparently the syntax was wrong. It works if you use /service_name/entity_1?$expand=to_entity_2,to_entity_2/to_entity_3.

simple bpel workflow : select query return multiple rows

I have to implement a simple bpel workflow, which only executes a select query on database. I have been able to create a Data Service wsdl file. Its flow is attached along with this question as an image file. Please have a look at that first. If you see the image, I some how ended up making a complex structure for parameter "Name" (auto-magically generated wsdl code by wso2 Data Service Server). It has a complex element called "Customer" which has 2 string values "Name" and "nid". I have also copied the wsdl file in case you need to see it. Here: http://pastebin.com/QTKZbdzn
I believe I am not sending any input parameters, while when I try to directly invoke the Data Service without Receive module, it gives an error, saying "No Start activity has been defined for the process".
Anyone who has implemented a similar BPEL workflow for the Data Service, please let me know. The data service works fine! I have tested it separately. thanks!
UPDATE
I ended up making a BPM like this:
I have to change the DSS also, so that I provide some input to the BPM. Like rather than "select * from customer" I am now implementing "select * from customer where nid = ?". It proved to be pretty succesfull. Thanks for helping me out joergl & vimesh. But if you still figure out how query with no where clause would work, update it here.
I have made a bpel flow with data service.
The very first thing we need to do is adding a receive element in the bpel flow. Actually it let us to send a request to the bps and at the same time bps makes a new instance with the request.
So then you can do whatever you wish, like invoking ESB proxies, DSS services, etc. while invoking the external service you can parameters to that request. Even though you are not sending any input parameters to the DSS service you should make a request to the DSS inside BPS in the correct format.(I mean the body part)
You can simply go ahead with the bpel samples available in this and then better start with DSS integrations.

Posting JSON data to Web API - where do I even start?

I have zero experience with Web API and JSON. My requirements are to create a service (I'm using Web API for this) that will accept MIME Encoded JSON data. The service will take that data, insert it into a database, and return the primary key value back to the client.
My hang-up is being able to know where to even start with this. A couple of questions that I have are:
When the device sends the JSON data, how will the service "accept" it? Meaning, what's being passed to the service isn't an URL that we commonly see with MVC (/Controller/Action/ID) which then invokes the Action Method. So, how will the service know what to invoke if I'm passing raw JSON data?
How would I test this if I don't have a device that sends the JSON data yet? Would I manually invoke an AJAX call and call that particular action method and pass in the JSON data that way?
I apologize for the seemingly elementary questions.
Thanks.
When you call a WebAPI-method you still have to specify the endpoint:
Example:
PUT /api/people
MVC knows from that that it should call the put-method on the PeopleController.
You can send raw JSON-data to test it. A good tool for that is HttpFiddler: http://fiddler2.com/
As for where to start, try to create a basic WebAPI-project with visual studio, it will include some samples and you can get going from that. If you run into wall, you can come back here

How to escape a period (.) in WCF Data Services QueryString

I have a WCF Data Services service that exposes a set of ICD codes. The primary key for the underlying table and the data set that WCF provides access to is a varchar or string in C#.
The service works properly if I have a query like this:
http://somehost/someService.svc/IcdSet('001')
If, however, the ICD code happens to have a . in the identifier as many do, the service fails. Here's an example of one that won't work (IIS gives a 404 - Not Found response):
http://somehost/someService.svc/IcdSet('001.1')
So the question is how can I escape the period or properly pass it to WCF Data Services? It must be interpreting it as a different type of filter condition.
Note: The code for the underlying class seems irrelevant to the question but I can provide it if needed.
Edit: My guess at the moment is that IIS is trying to find a file that ends with .1') which is then producing the 404 error. But how can I tell IIS that it shouldn't be looking for files as these are all data queries?
check this out http://blogs.msdn.com/b/peter_qian/archive/2010/05/25/using-wcf-data-service-with-restricted-characrters-as-keys.aspx
Also might be of interest if you're using .Net 3.5 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5121

Resources