BigQuery Storage Write API with C# - c#

I recently discovered that version 2.5.0 of the Google.Cloud.BigQuery.Storage.V1 library now supports the Storage Write API as an alternative to the legacy streaming API (i.e. insertAll):
https://cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.Storage.V1/latest/history
My initial impression is that the C# libraries are similar to the Python example where a compiled protobuf definition is used to initialize the schema definition. I was hoping to find an example closer to what is provided for the Java client where a JsonWriterStream is provided:
https://cloud.google.com/bigquery/docs/write-api#write_data_using_the_jsonstreamwriter
I would really like to use the BigQuery Storage Write API and would like to know if there are any examples of using the API that matches the simplicity of the legacy streaming API?

There is currently no manual layer written on top of the C# client. Java is the only language currently that supports JSON ingestion. Also, even if manual layer is added for C#, it most likely won't be as easy to use as insertAll (legacy streaming API) since the Write API is a fundamentally different API that supports exactly-once semantic (insertAll is best-effort deduplication) and batching (you have to use Load instead of insertAll for batching).
Here is an article on the overview of the Write API: https://cloud.google.com/blog/topics/developers-practitioners/bigquery-write-api-explained-overview-write-api
More content will be available to talk about the fundamentals of the API.

Related

How can I used Oracle cloud infrastructure JAVA SDK in .Net application with C# to access storage

As per my knowledge oracle oracle cloud infrastructure API can be used in .Net application to access database.But I don't know if it is possible with JAVA SDK
This question appears to more generally be 'can I call Java functionality from C#?' I suspect the answer is yes, but I don't have the details on that. Please take a look at these posts related to that:
How to call Java code from C#?
https://github.com/jni4net/jni4net/wiki/Calling-Java-in-C%23
https://www.c-sharpcorner.com/UploadFile/ajyadav123/invoking-java-code-in-C-Sharp-net/
However, I wanted to make sure you know about the C# signing sample that we have available in the OCI documentation, which calls out how to make HTTP requests to OCI services using C# code. This would allow you to not have to use the Java SDK at all from your C# application, and instead use only C# code to talk to OCI.

Typo3 C# interface (SOAP or REST)

I've got the task to connect a platform based on .net via a plugin to Typo3. I'm not very familiar with Typo3, but with the .net stack (actually using C#).
The requirements include writing data to Typo3 and retrieving data from Typo3.
Looking at the Typo3 API documentation (http://api.typo3.org/), I don't find any information on the interfaces I could use, or even how to stuff data into the system. I used all my favorite search engines, but ended up here. (Or I just searched for the wrong terms?!)
Following requirements have been provided additionally:
No writing/reading to/from the database (we don't get access to it for multiple reasons)
Use of a general solution (which could be re-used for different entities)
Synchronous process (so we get an error when inserting data has failed, etc.)
No batch import/export solution
Authentication must be used
What I search for is a simple interface which I can consume from my plugin. Something like SOAP, REST or any variant which I can call via http/https - including authentication.
Do you have an idea?
There is no external API built in TYPO3 out of the box.
Quick search for REST or SOAP based extensions (http://typo3.org/extensions/repository/) to provide e.g. page structure and contents from TYPO3 doesn't provide any results either.
The only solution is to write an own extension providing a SOAP or REST API to access TYPO3 data.

PHP to C# and Vice versa

I'm in this project:
A web page that's gonna be used by the front-end company people to query and update data from a SQL DB.
I'm working with visual studio and the code behind (C#) is almost done, so the interactions between SQL and C# are ok.
My original idea was to work with ASP.NET which is familiar to me, but that's not gonna be possible. I have to switch to PHP.
So, today is my first day learning PHP, checking http://php.net/manual/en/index.php and a lot of things seem quite similar to ASP.NET so I guess it won't be that hard.
Anyways, some questions popped up quite fast as I wanted to script something else than a "hello world".
Is there an easy way to get/send C# variables from my class using a php page? I've read soemthing about using XML in order to do so, but still I'm scratching my head, is there another, easier, way to do this?
You have options.
direct integration. PHP can instantiate and use .NET objects . See the DOTNET library in PHP. So if you run PHP on Windows, and you expose your .NET logic according to the requirements of the PHP DOTNET infrastructure, then you can just call .NET classes directly from PHP. Some restrictions: PHP is built to integrate with the .NET 2.0 runtime. You can't build .NET 4.0 objects and connect to them from PHP.
synchronous network protocols. As others have suggested you can expose your C# logic via aREST or web services interface, then invoke those services from PHP using the curl library or file_get_contents(). The C# logic could be, but need not be, publicly exposed. In other words, you could make it accessible only from within the firewall of your app, so that no anonymous public access is possible. on the other hand your architecture may call for access to the same API from 3rd-party or user apps. In that case it needs to be exposed publicly.
in either case, public or private, you will want to use WCF or ASPNET MVC to expose these services implemented in C#.
asynchronous mechanisms. PHP can connect to MSMQ. See Using PHP to Open MSMQ Queues . Of course C# can do likewise. You could use MSMQ as a buffering communication mechanism between the two worlds. To do this you'd need to come up with a data serialization protocol, for the messages you put and get on the queue. JSON or XML would be appropriate choices here.
Database. If you are concerned about employing MSMQ as it is "one more piece of infrastructure to manage" you can also employ a database as a go-between. A shared database can be accessed by both PHP and C# and used as a message queue or communication conduit. PHP inserts messages in a MySQL Table, and the C# app could read and process them, then place reply messages in a different table. This would require some work by you to design the message formats, protocols, indexes, and request/reply correlation mechanism. But it relies on proven, existing technology that you already know how to use.
Finally, there is Phalanger. This lets you compile PHP onto the .NET Framework. This means integration between C# and PHP will be simple. I haven't tried this but it might satisfy your requirements.

iOS development using C# APIs

I am looking to get into doing some iOS development for a nice addition to a project i am running.
The main project is currently written in C# and is mainly asp.net with a few windows services.
I would like to incorporate this to be able to develop a basic iPhone app as a proof of concept.
From what i have read and understand, its generally best practice to use JSON as a communication medium for iOS.
I am thinking about using WCF to create the API methods so the iOS app can connect to these services to get the data.
Are there any nice tutorials to do this?
Take a look at:
Developing RESTful iOS Apps with RestKit
I do this all the time. WCF Data Services (OData) are the way to go. With OData services, you can specify that you want JSON response by passing (Accept - Application/JSON) in the HTTP Header and OData will return JSON to you.
I have used several libraries for getting OData (which are REST services) from iOS. Microsoft's iOS OData implementation is pretty lame. RESTKit does a really good job for what it handles, but is really painful if you have to do something that it doesn't. I have also used ASI - it is much more flexible than RESTKit, but is not without problems. I ended up writing my own and it suits me just fine.
For a beginner, I would recommend using ASI over RESTKit. RESTKit, while doing a lot of the heavy lifting for you, takes a bit to get working right.
There are two things that are not standard when receiving JSON responses from OData.
1. All responses are captured in a JSONDictionary with the key of "D".
2. Dates are serialized to the JSON standard (number of seconds since 1970), but they are placed in a string like so: /Date(1212353), so you will have to parse out the Date() part of the string before you can use it.
RESTKit doesn't handle either one of these issues natively, so you will have to deal with them if you choose that route. Personally, I would go the ASI route until you learn enough to write your own.
I am considering open sourcing my solution - if I do, I will update this response with the link to it.
---UPDATE----
Just to be clear - if your server side system uses WCF Data Services, otherwise known as OData, then with minor tweaking, RESTKit plays nice with it. If your services are traditional WCF Services (i.e. SOAP Binding), then you will not be able to get JSON out of them because they are bound to the SOAP protocol (Unless you create a custom Behavior to translate it - which I wouldn't do). It all depends on what your services do in essence. If your services are typically data exposure/manipulation (i.e. addCustomer), then you should expose them as OData. If they are truly operations, then you should maybe consider exposing them as actions from a MVC site. Either of them can get you REST services using your existing infrastructure and platform.
If you're using Objective-C to develop the iPhone app, I'm not sure WCF is the best web service technology to use on the server. Check out ServiceStack to create a RESTful service.
Refer following link:
http://www.kotancode.com/2011/04/26/backing-your-ios-app-with-wcf-json-web-services/
It has included comprehensive code samples as well.

create a c# wrapper for rest based service

How does one go about creating a c# wrapper for rest based service.
I want to access the rest based API at
Www.zomato.com
inside my Silverlight app.
Any guidance is appreciated.
I would take a look at some examples, there are numerous ones out in the wild. The following is a great example for twilio's rest api; it leverages RestSharp under the covers. RestSharp is a great libary (available via nuget) to help out with the heavy lifting of interacting with a web api.
Note: Microsoft is coming out with a richer HttpClient option in .net 4.5; in fact, you can get it now via nuget.

Categories

Resources