SOAP server and client application VCL+indy demo for Delphi XE? - web-services

Delphi used to include a demos folder for web Services, but no longer seems to include this.
I just tried the Delphi 7 demo projects (SOAPDMServerWAD, a server with almost no UI at all, and SOAPDMClient) and was unable to get them to function, even in Delphi 7.
If anybody has ever made a similar demo work in Delphi XE, or Delphi 2010, identical to the old SOAPDMServerWAD+SoapDMClient demos, working in Delphi XE, and with at least the minimal UI that comes from the Delphi SOAP Server application wizard, that would be perfect.
Update: The demo appears all the way up to Delphi 2010 but uses the now-obsoleted WAD (web-app-debugger), I tried to port it to the new Indy runtime/web-app-development-harnessing-code, but I can't seem to get it working. The demo runs, but the server has no User interface, and does not appear to be running any HTTP server (tested using a regular web browser, via http://localhost:port/ urls. By the way, try googling for a demo, and this url comes up, and I asked less than an hour ago. That's scary, google.
Update2 See my own answer below, a link is coming soon with working code.

I have posted the complete set of demos for SOAP on CodeCentral as item 28789.
These contain every single one of the Delphi 2007 era SOAP demos from the WebServices folder, now updated for Delphi XE and XE2, including converting the old WAD servers into new INDY VCL servers. You'd think that was impressive, except it's not. It's really easy. Just use the wizard to create a new project, and then add the web service interface and implementation units, and any other units that belong in the old demo, to the project. Once they're added to the project, they just work. Basic demo SOAP Servers are really easy to build in Delphi, once you have a working demo, you'll find it's pretty easy to modify and extend it.
The demo that best answers the question I asked above is in the SOAPDataModule sub-folder.
The basic problems with the demo from the 2007 era are two:
The WAD (web app debugger) is gone. you have to make a new server using the Indy server, for optimal demo purposes, saving you from using WAD (which is gone) or setting up ISAPI environment, under IIS, which is hardly ideal for demo purposes. The new demo project I made is called SoapDMServerINDY, and it consists of a data module (datamod_u.pas), a VCL form User Interface unit (IndyServerVCLFormUnit.pas) and an Indy Server web module, called IndyServerWebModule.pas.
The Delphi 2007 demo broke thanks to the new practice of having a Debug/Win32 subfolder that the demo executable is now in, you need to go up further. I fixed the demo server so that it warns you with an error message if the data files cannot be located, saving you from the mysterious "XML parsing error". I also added some error checking in a few of the demos so that it tells you that you need to install interbase for this demo to work, since some of the demos require Interbase installed and running, and one requires an alias called IBLOCAL to exist, and preferably a table called EMPLOYEE to exist.
The elements of this demo are a server (SoapDMServerINDY, based on the code from SOAPDMServerWAD), and the client SOAPDMClient which connects to the demo and has two pages, one page will show basic data access via a DBGrid + dataset remoting, and the second page shows how to invoke a custom SOAP method.
To use the demo: You have to start the server, click the start button, then start the client and click Connect.

Related

SharePoint 2013: Consuming query (url) filter in custom webparts

I am building webparts and self hosted apps for sharepoint 2013, I want to consume the Query String filters that the user sets up, the process should be as simple as specified here on this microsft site.
Unfortunately I dont get the option to send values to 'my web part' but I do for other stock webparts that come with sharepoint. Which leads me to believe I need to implement IFilter or equivelent in my webpart, I have found information into IFilterConsumer interface and IFilterProvider interface on msdn which seems to be exactly what I need, however the documentation has one snag:
NOTE: This API is now obsolete.
So My question is, what is Microsofts new intended way of doing this with Sharepoint 2013.
Ultimately I need to read query variables in the HostWeb request inside my AppWeb code.
Edit: Apparently IWebPartParameters is the new interface for this.... trying to implement now.
I have also tried whats suggested here:
Passing parameters through sharepoint sitepage to web part Still not working, at the moment I have implemented IWebPartParameters, IWebPart, IWebPartRow and none of my functions that implement these interfaces are being called. I must be missing something in the manifest or features file maybe?
Thanks in advance
Crash
Ok the answer to this question is simple, firstly you can only do this in a dev environment with sharepoint installed, as you need access to the sharepoint.dll.
Then this thread answers the question http://www.manning-sandbox.com/thread.jspa?threadID=19791, with the following code solution which is here http://www.markitup.com/BookCodeSamples/TestingWebPartConnections.zip

How to create a login application with Visual Basic (using WebHttpRequest)

Hei there, I'm not experienced at all in C++ as I need to start learning year the next year at my university, though, I've been creating a browser based game and I'm looking for someone to transform it into pc app.
Though, I'm wondering how to make that application send a http request via POST to a file on my webserver with the username / pw.
After all the tutotials I've been reading, I concluded that none worth spending my time with, because they all based on own database, and I'm looking for one that connects to a maestro server and requests the data from there.
This may not be the answer you are looking for, but you may consider two alternatives to a more pure C++ application.
If you already have a working browser game, try to take that same code and put the html/javascript/whatever in a file and give the file a ".hta" extention. It basically opens inside a browser to run your files, but it acts more like an application from the user's viewpoint. (And, as much as I hate Windows, they're pretty fun to create if I may say so). However, your source code with this option is easily read because it can be renamed to a text file (or html file).
You could use Visual C++ (or VB.net, which you have tagged to the question, as well as "Visual" C#) to create an application which mostly consists of a browser view. It could be a "standalone" application (however would rely completely on the .Net framework - may or may not be what you want) that basically accomplishes the same as the option above, but adds that you can "hide" your files inside your application.
Using the two above alternatives, you could make an application relatively quickly that would load your files, which I assume you have already created. Note that neither of the above alternatives will work on anything other than Windows OS's.
If the two above alternatives are not what you want, or if you have questions about either one, I'd be glad to attempt to help.
I've been able to find a friend that would do it in Delphi because I wouldn't want users to download net framework just for this ap.
So the program that would fit most for any apps is Delphi Prism XE (even if it's an addon of Visual Studio)

javax.ejb.Stateless class undefined

I am currently trying to implement a web-service assignment given by my college.
My Assignment is..,
Consider a case where we have two web Services- an airline service and
a travel agent and the travel agent is searching for an airline.
Implement this scenario using Web Services and Data base.
For that as a newbie I tried to follow the steps given in this link.
I opened the Netbeans beta 2, and exactly followed the steps as given in that link.
But while trying the steps,
Deploying and Testing the Web Service, I tried to run the CalculatorWSApplication, I noticed that javax.ejb.Stateless is undefined.
And I have three questions,
I have a basic knowledge of , JSP, HTML, WEBSERVICE. Please give me some basic idea/basic schema of the assignment such that I could proceed with the next steps and implementation.
How could I get rid-off from the missing ejb file.
Generally .java files will refer to the libraries present in jre and why in this program, CalculatorWS.java refers in this path C:\users\MuthuGanapathy\.netbeans\7.0beta2\var\cache\index\s3\java\14\gensrc\javax\
Let me try to answer your questions:
First of all: You don't really need knowledge of JSP and HTML for creating WebServices. If you are interested in additional knowledge rather have a look in subjects like SOAP, WSDL or XML (on which SOAP and WSDL files are based). You can find good informations at w3schools.
As said in your assignments requirement you'll have combine your service with a database, therefore you'll have to face the fact that WebServices aren't able to send every kind of data. For example, if you intend to use some kind of JPA you wont be able to send entities between Client and Server via WebService easily (though its possible).
For the reason of that my approach would be to send simple datatypes between client and server and, on server side, build my complex objects.
This would force me to code at least 3 classes (one for each webservice and one for communication with the database).
Airline WS:
#WebService
public class Airline {
#WebMethod
public String stuffToDo {
// do your stuff
persistOrSelect(complexObject);
return "success";
}
private boolean persistOrSelectData(Object complex) {
// Database stuff here
DBdao.doStuff(complex);
return true;
}
}
TravelAgent WS:
// same structure as shown above
DB class:
public class DBdao {
public static doStuff(Object complex) {
// get DB connection and INSERT, SELECT, UPDATE
}
}
In this scenario you didn't even have to use a class out of the javax.ejb package but I understand that this could be necessary :).
I don't really use Netbeans and therefore I can only speculate. I think that your problems 2.) and 3.) relate to each other.
The javax.* package normally is located in your JDK and should be specified in your IDE inside the server library/target runtime your using.
Do you have assigned the server library to your project?
Have you tried to point your Netbeans installation to your JDK path as shown here and here?
It could also be possible that your project do not have a reference to the Java System library.
Last but not least:
There are several ways for testing your webservice:
You use Netbeans therfore I assume that you deploy your project on an Glassfish server.
After deployment you can navigate to your project inside the admin gui and click the link pointing to view endpoints. In the next window your able to either follow a link pointing to the generated WSDL or to a tester
You can write your own client by either following the tutorial provided or, for a more general approach you can use this.
Use soapUI for testing (it's available as standalone application or as IDE plugin)
I hope this helpes, have Fun!

How to run C++ applications on a webpage?

Are there any tools to run C++ applications written in QT on standard web browsers?
My C++ app has to run from a webpage, do some math, and return the result back to the webpage.
Check out NaCl (Native Client). No Qt, but you can use c++.
You can't. You can write the server side in a web app in C++, of course, but the Qt GUI framework is only for applications that show their user interface on the machine they are running on. (With the usual caveats in the case of remote X11 connections and so forth, but that won't help you for a web app).
I have read about a sample application like this. I think you can search for this term "Qt WebKit Hybrid application". In that example, the user interface is written in HTML and Javascript and the backend in C++. Even, the C++ objects ownerships can be transferred to Javascript. I'm not sure I'm correct but I'm partially correct.
EDIT:
Here is the link.
https://developer.qt.nokia.com/wiki/Server-Driven_UI_with_Hybrid_QtWebkit
It's possible to compile C++ code to JavaScript using Emscripten, and then call compiled C++ functions from JavaScript, as explained here. This will allow you to run C++ code in a web browser or other JavaScript environment, without any additional plugins.
There is one more solution to this, you can write a browser plugin. I think that this is better then ActiveX and NaCl. For details on how to write plugins check this: How to write a C++ FireFox 3 plugin (not extension) on Windows?
Maybe you could embed the code in an ActiveX control.

OutOfMemoryException when building Silverlight application using CRM2011 OData Service Reference

Following the instructions supplied with the Microsoft Dynamics CRM SDK CrmODataSilverlight sample code I have downloaded the OrganizationData.csdl from my CRM2011 solution and readded my service reference with it. The csdl file is 4.8mb and has generated a Reference.cs in my solution of 13.4mb.
When I attempt to build my solution I get an error stating 'Source file '...\Reference.cs' could not be opened ('Exception of type 'System.OutOfMemoryException' was thrown.')
I have restarted my machine and attempted to rebuild however I get the same issue.
What approach can I take to allow my Silverlight application to build with this service reference? Can I get a cut down version of the csdl from CRM2011 containing just the entities I am interested in or is there another approach I can take? I don't fancy having to manually edit the csdl file as it makes maintenance a nightmare.
Here's an article about filtering out items when generating a proxy from crm 2011.
Probably not exactly what you need for silverlight but hopefully points you in the right direction.
http://erikpool.blogspot.com/2011/03/filtering-generated-entities-with.html
As for the out of memory, you can try to increase your virtual memory amount in windows.