Typo3 C# interface (SOAP or REST) - c#

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.

Related

BigQuery Storage Write API with 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.

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.

Magento API - Link simple product to configurable product

I'm writing a middleware solution which should be able to take products from a specific source and add/update these to/in Magento.
Since there are products with different sizes/colors/etc I'll need to make use of Magento's configurable and simple products.
Adding the products does not expose a problem, linking a simple product to a configurable one however does.
Does anyone know how to accomplish this using the API?
I'm using C# and the v2 SOAP Magento API.
Using custom PHP code or CSV imports is not a possibility.
Thanks in advance!
This is not achivable via Standart API.
You should write your own.
We had project where we wrote Configurable API and other Company Java warehouse connector.
So you can try to directly access DB. Or try to find some module.
In Magento you can extend their API, either directly in the php code, or via a magento extension(preferred approach, as it allows you to upgrade magento). Neither of these approaches requires hitting the database directly. Rather you are using the serverside php api (lots of examples on the magento site) and using the php object/entity model and methods to do that.
Specifically the call that you're looking for in the product API is called getAssociatedProducts() This call is NOT availble in the webservices API, but you can call it via an extension that you write and make it available in the through the webservice API that way.
Alternatively you can get ALL of the products with attributes and try to link the association between configurables/simples that way, but that approach will obviously be much slower than the extension route.

Can C# natively talk to Websphere and call wsadmin commands?

I'm writing a small c# console application that needs to interogate Websphere Application Server ND (6.1) to retrieve a list of installed apps.
I can easily do this from the command line using the wsadmin command, but don't really want to launch wsadmin from my c# app.
Is there a way to natively get c# to talk to Websphere and get this sort of information ?
Wsadmin is just a scripting interface for JMX and everything you can do with it can be done with RMI and SOAP. For C# users that means querying for Management Beans via SOAP.
However there are no turn-key solutions available. What has been suggested before has been at least taking a look at the ws-jmx-connector and implementing your own library. You could probably easier just capture one of those queries with ie. SoapUI and replay the SOAP calls. This probably means too much work and that's probably also why there are no ready solutions.
Also, you could just read the XML files that describe the (properly) installed WebSpehre Application Server applications. That is probably much easier, and works just fine. Take a look at the server profile directory. You should see a directory called config, then under it cells, your management cell's name and under that you will find XML files that actually contain every setting you see in the management console. They are well parseable by the standard .NET libraries and a few of those will contain application lists. Take a look at serverindex.xml for instance.

Expose 3rd party interface (over WCF) to Silverlight

I searched a lot, apologies if I missed something obvious. And thanks for reading the looong text below.
I have a 3rd party (read: No way to access/change the source) application here. It consists of a server (Windows service) and an API, that talks to the server via remoting.
For several reasons I'd like to expose this API over WCF (see subject: One reason is a WCF client).
The problem is, the API is
unchangeable (follows 3rd party rule)
using no WCF itself (it is serializable/MarshalByRef where necessary for Remoting)
using lots of interfaces and internal implementation classes
Following 1 I cannot use the (quite intrusive) WCF attributes myself.
Following 2 the API itself can be used "over the wire" (they support remoting via TCP and HTTP), but remoting is not good enough for me.
Following 3 I have mostly interfaces (which WCF won't handle well, cannot (de-)serialize). The implementation classes could be sent over, but - I cannot access them.
The general usage for this API is based on a single interface (and its members/properties), so the typical usage is like
var entryPoint = new ApiClientEntryPoint();
entryPoint.SomeMethodCall();
entryPoint.PropertyExposingAnInterface.SomeOtherMethodCall();
and so on.
What I'd really like to do is generate (with as little effort/code as possible) a proxy (not in the typical WCF sense) that I expose via WCF and that serializes this hierarchy mapping every call/property on the client to the real thing on the server.
The closest I've come so far is stumbling upon this project, but I wonder if there are more/other tools available that take a medium to large part of this work off my shoulder.
If there are any general other advices, better approaches to wrap something preexisting and unchangable into WCF, please share.
My advice is to use a facade pattern. Create a new WCF service that is specific to your usage and wrap the 3rd party service. Clients would talk to your service and you would talk to the 3rd party. But clients would not talk to the 3rd party directly.
This would work in most but not all scenarios. I'm not sure of your particular scenario so YMMV.
BTW you can look at WCF RIA Services which is good for exposing services to Silverlight where you can avoid doing a lot of the hand coding of service stuff. But again depending on your particular scenario it might not be the best way to go.
Edit:
It's now clear that the API is too big and/or the usage patterns of the clients are too varied in order to effectively use a facade. The only other thing I can suggest is to look at using a code generation tool. Use reflection (assuming it is a .NET API?) to pull apart the API and then codegen new services using the details you gathered. You could look at the T4 templates built into Visual Studio or you could look at a more "robust" tool such as CodeSmith. But I'm guessing this would be some painful code to write. I'm not aware of an automated solution for this.
Is the API well documented? If so, is the documentation in a parseable format such as XML or well-structured HTML? In that case you might be able to codegen from the documentation as opposed to reflecting through the code. This might be quicker depending on the particulars.
Okay, hair brained scheme #1 on my side:
Use Visual Studio Refactor menu to "extract interface" on 'ApiClientEntryPoint'.
Create a new WCF service which implements the above Interface and get VS to generate the method stubs for you.
'For PropertyExposingAnInterface.SomeOtherMethodCall' You will have to flatten the interfaces as there is no concept of a "nested" service operation.
Your only other option will be to use T4 code gen ,which will probably take longer than the above idea.

Categories

Resources