Convert/Use API written for C#/Java with PHP - c#

I have access to an API that I would like to use, but it only has documentation in C#/Java. I know neither of these languages and would love to use the API in PHP. I do have access to the API's WSDL and was wondering how I might go about this?
I've heard various other ways such as SOAP calls or converting the WSDL into PHP Classes. Any information is very helpful. Thanks!

While I haven't used Soap's native functions, I have used NuSoap with a WSDL document that's generated from a Java system. Overall its worked pretty flawlessly; the only problem has been when they've changed how they do authentication and I've had to make some manual changes. Other than that, I've just had to update the WSDL when they do upgrades.
If I had a newer version, I probably would have just used php's native functions.

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.

Call a C# service through C++

I want to make a call to a web service that is written in C#, through Visual C++ or C++ in Visual Studio 2010. I searched on web but was not able to find any point to point document. It would be a great help if you will tell me.
If you're prepared to go with managed C++ then you can use WCF.
However, if this isn't an option then your best bet is to go with a socket approach. You'll need some cross-language way to represent the data your sending from C++ to C# and back again. Google Protobuf will help here as there are frameworks for both languages, in addition to many others.
A web service uses something JSON or XML as an interface and is inherently language independent. You would have to look for libraries that can create requests to the web service. For example if your web service in C# uses SOAP (XML) which it would if you created the default web service in Visual Studio you could create your own request in XML in accordance to the specifications of SOAP:
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/
or use one of the libraries mentioned in this question:
Generic WebService (SOAP) client library for C++
Have a look at Walkthrough: Accessing an XML Web Service Using C++.

Is Python good for writing standard, compatible and complete SOAP web services?

I have used few python soap libraries (SOAPpy, soaplib and Twisted wrapper around SOAPpy) to write my soap web service.
When I used python clients (SOAPpy.SOAPProxy and SUDS), I was able to communicate with my web service (returning simple and complex type objects).
But, when I tried with C# ASP.net, I got many issues. I came over returning simple types (int, string, double, boolean) issue with some hack into SOAPpy library. But, I am still struggling with returning ComplexTypes from SOAPpy.
I could not find any complete, compatible alternative python library for writing my web service.
Main Question: Any suggestions/examples for dot net compatible complex type return from python web service would be highly appreciated.
Note: I had to hack SOAPpy quite a bit to make it working in first place. And, I had to handwrite wsdl file in case of SOAPpy.
In my personal opinion, the compatibility of Python SOAP libraries with other platforms is not good.
I think that there are two issues here:
First, the compatibility of web services among web service stacks is an aspiration rather than reality. For example, look at this question to see how to use web services between Java and WCF.
That being said, the concept of WSDL which is largely compile time typing is not in line with Python's original philosophy, so less effort was put into it.
I haven't worked with web services for over a year now so may be things have changed. But the advice is the same as in the previous question:
Start with the WSDL writing if you are using more than one language/library.
As copied from the other question, "start with XSD, but confine yourself to mainstream types. Primitives, complextypes composed of primitives, arrays of same."
In the end I settled on using suds for Python web clients, after experimenting with it and soappy and zsi. That was after some time using a C based library (gsoap) and linking to it from Python.
I was never satisfied with server implementations in Python, so I used to build Python servers and connect to them from another library which can export SOAP services (in my case Java or C, you will probably use C#). The connection is usually a much simpler protocol.
That being said, if you start with WSDL you are likely to get good results using soaplib or may be zsi. But I am afraid there is almost no way around building your types slowly while checking for compatibility.

Open source equivelants to wsdl.exe? (how to autogen a web reference proxy class)

As an ASP.NET developer, I'm used to working with how VS/C# transparently autogens proxy classes for web references via wsdl.exe (yes, I know, we're spoiled), but now that I'm creating documentation for more than one coding platform I'm trying to discover what the equivelant to that is in any other framework.
So is there a similar way to work transparently with web reference proxy classes for say, RoR, PHP, and Python?
And if there's nothing integrated, are there tools you recommend to autogen the proxy classes, or do you recommend to roll custom classes?
I've had (limited) success with ZSI http://pywebsvcs.sourceforge.net/ for Python. Try at your own risk.
If it would be possible to run IronPython or IronRuby I would check that out.
I definitely know how VS can spoil you.

Fastest way to share data objects between a Java server and a C# client

What is the fastest way to share data structures between Java and C#? I want something where I can literally send a "car" object or a "foo" object and have it serialized and deserialized on both server and client.
WSDL (SOAP) is fairly interchangeable. If you want something less chatty, anything like Google's "protocol buffers", "ICE" (ZeroC), etc offer interchangeable binary serialization and code generation.
For .NET / C#, there are currently two viable protocol buffers implementations here; protosharp is essentially inactive and incomplete) - either would be fine, but neither currently has a complete RPC stack, so you'd have to handle message passing yourself.
You might be able to use IKVM, it's a Java-like environment on top of .NET; you could use Java serialization on IKVM and use interop to use the objects from "regular" .NET languages.
It looks like the IKVM seems like a good idea. But if that doesn't meet your needs especially since it is still in development. However, Uri's post points you in a good direction with the use of xml and passing messages, which can be built back together on either side.
Would you be able to use a SOAP web service on the server and have the client consume the web service?
The object's data structure would be described in the WSDL for the web service.

Categories

Resources