execute delphi web service from browser - web-services

I've been working on a set of ISAPI web service DLLs in Delphi 2005 that interact with our server application but I'm having real difficulty debugging issues in the web services.
At this time, I have a test SOAP server application as a Web App Debugger executable which uses the same units as the real DLLs.
I can compile and run my SOAP EXE, run the Web App Debugger tool, start the ServerInfo server, and see my SOAP app in the list of Registered Servers.
If I select it from the list and click on Go, it shows the normal Service Info Page, where I can view interfaces and the WSDL.
What I now want to do is Execute one of the methods (a simple one that returns the version info of the ISAPI DLL), and view the request and response by looking at the Log tab of the Web App Debugger, however, I've not found a way to execute the method.
Do I really need to code a special client app to test my web methods? Most examples I've seen online just say to use http://server/service/class/method?parameter=value to execute a web service method, but that doesn't seem to work with a Delphi SOAP web service.

You need to change the client to connect to the machine running the WebAppDebugger. (Typically localhost)
Run the WebAppDebugger and click on the Start button. The 'default URL' lights up... by default is
http://localhost:8081/ServerInfo.ServerInfo
Then run your WAD server project within the IDE and put in your desired breakpoint somewhere in the server code.
If running your client on the same machine, change your client to use the local host address... if you connect today to:
http://www.yourhost.com/yourapp.dll/yourclass/yourmethod
change the client to connect to something like this for debugging the traffic:
http://localhost:8081/wadClassName/yourclass/yourmethod
The name of the Web Application Debugger class is defined when you create the WAD project.

Related

Codename One: Webservice not available

I used the CN1 Webservice Wizard to add a the webservice proxy to my mobile app and to generate all the server side code. I have a local XAMPP installation with a tomcat linked within my Eclipse IDE. Also, I imported the server generated code as a new Java Project and added the "Dynamic Web Module" project facet to it so that I could launch it not as a local Java application but rather on the Tomcat server.
When starting my client, I noted that I get HTTP 404, resource not found errors. I traced the error back to the URL, where the server is hosted to.
I know I have to adapt the urlPatterns parameter in the generated class CN1WebServiceServlet, which I did. Also, I checked the context of my app in the Web project settings and defined the value for context root. So, in my client app, the URL to call the service should be
http://localhost:8080/< context root>/< urlPattern>
However, even when calling that in the browser, I should get the result of the doGet method of the server generated code, showing the message "Webservice access only". Instead, I get 404 errors all the time.
Is there some problem to importing the server generated code as a plain Java project and adding the web parts to it afterwards? How would that be done in the ideal case?
And what other problems might be hindering the URL from properly being published on the server side?
Thanks and best regards
EDIT
I stripped everything from the project to limit the options and I found the cause: when using the web service wizard to dump the source files into a new directory, adding that with the Eclipse import wizard, it will be looked at as a plain java project without any web components. Using the project settings to add the dynamic web piece to it (Eclipse calls those project facets), the CN1 webservice will NOT work.
If instead you create a "Dynamic Web Project" first and then use the CN1 Webservice Wizard to dump the server source files into the "src" folder of that project, it works without any issues.

Having RESTful service in RCP application

We have an existing eclipse RCP application that works as a standalone product. At a high level, this product is used to configure a image specification using its UI and we can export a sample Image based on these configuration.
Now we are developing another web application that has several modules and one module of it is to develop something that our eclipse RCP application does.
Just to provide a QUICK integration of the RCP application for demo purpose, I plan to run the RCP application separately in the server machine and expose its static functionality as a RESTful webservice. So the module shall make a RESTful call to the RCP application.
Now just to begin with I tried to embed a jetty server for hosting the REST service during the start of RCP application like below
But the thing is after the Jetty server is started I am not able to access the TestWebService using the path i configured. So I am confused if this is the right approach to have a RESTful service inside a RCP application. Please note that iam able to hit the server with http://localhost:1002, but not the service.
Following is the console log when i hit on http://localhost:1002/hello/test:
It's a really weird architecture you're experimenting with.
I mean to write an RCP-application which listens on a port and offers REST services on it; this could lead to further obstacles.
Instead I would seperate it into two software artifacts: an RCP-app and a web-application (.war).
You could extract a business-logic jar (It can be an OSGi plug-in if necessary) contaning your image manipulation logic.
Then include this plug-in/.jar as a dependency in the webapp and offer out it's functionalities thru a Web-container (Tomcat, GlassFish, etc.)
So your other (third) application will connect to the Web-services offered by this .war file.
opt.1) If you need a single running instance (because of database or other shared resource) then your RCP-app will have to use this REST service too.
opt.2) If not then simple compile the .jar/plug-in containing the business-logic into your RCP-app.

Is it possible to run an application from a remote server on a website?

I have a website that I would like the customers to navigate to a page where it runs a program that I wrote. However, the program is on a separate server. How might I run the application from that remote server onto the server that hosts the website?
It looks like ideally I'll have my web host as GoDaddy.com and I'd like to run my application from that website.
Any thoughts?
What kind of technology are you employing to deploy the apps? ASP? PHP?
It seems that you were actually trying to "Window" the app on another server to your current site, if that's the case you can just simply link the app inside an iframe of your site.
Reference -http://www.w3schools.com/tags/tag_iframe.asp

Run C++ code on web server and call it from an application

I'm a complete newbie when it comes to web development and server management, as I've always coded desktop applications.
I want to make a desktop application which does this
Send data to a web server (http://... address)
The web server receives the data and does calculations via a C++ application stored on the web server itself
The web server returns the computed value to the desktop application
Is this possible? Where do I get started?
My web host is http://www.namecheap.com/
It seem that you want to create CGI. If you are a newbie take a look on CGI programming.
With Boost Asio you can program your own server and client in C++, and process what you want in C++.
Look at the tutorials, there are several examples of HttpServer and HttpClient.

ASP.NET Web Service returning Bad Request in Windows Azure

After a Windows 7 fresh restart, I open the Visual Studio 2010 as administrator, create a new project of Windows Azure Project with ASP.NET Web Role, then at the WebRole1 project I add a WebService1.asmx and press F5 (run).
The Windows Azure services starts OK and the browser open the http:/127.0.0.1:8080/WebService1.asmx perfectly. But when I click at Invoke button to test the webservice method I always receive a Bad Request - Invalid Hostname, with a http:/127.0.0.1:8081/WebService1.asmx/HelloWorld.
The most likely cause is ASMX's WSDL file doesn't stand by load balanced environment such as Windows Azure. The test feature relies on WSDL. You will see similar issues if you add a web/service reference. It is recommended to upgrade to WCF. In WCF, you can use useRequestHeadersForMetadataAddress (http://msdn.microsoft.com/en-us/library/ee816894.aspx) to fix the issue. If you need to use ASMX, please try to manually provide a correct WSDL file.