1.) I can create a simple application which has one routine called
function ConnectToDB: Boolean
and run it from my virtual directory (wwwroot/cgi-bin) and it connects and reports back connected .
2.) I can create a simple web service helloWorld
function helloWorld: String;stdcall;
I can create a client and call my web service call "helloWorld "and get my "HELLO WORLD" string reported back to me - everything works great.
3.) NOW, if i take my connection code from step one (1) and put it into a web service, i can not connect to the DB. It always reports back false.
Note: I am Using Delphi 7 to create my web service. I am using DBXpress as the conduit to the MS SQL Server DB, and the two INI files (dbxconnections.ini, dbxdrivers.ini) and two DLL's required for the connection reside in the same folder as the executables (wwwroot/cgi-bin).
Any help would ge greatly appreciated! Again, please be aware of steps 1 & 2, before responding.
Thanx!
How does the connection connect - does it use integrated windows authentication, or do use sql authentication - could it be that integrated auth doesn't work because iis is running as another user.
Also, when you connect, are you ensuring you disable the username/password prompt?
Related
I have added this question on ServerFault but no one replied.
I have a .net application which calls a webservice deployed on my local windows server 2012 on IIS, and the sql server database resides on that server too. All employees connect to the same service and DB since we're all on the same domain, and I publish the app and webservice to the server through visual studio (2012).
Now I need to make employees access this application when they are outside the company's network, so I deployed the webservice on IIS on one of our remote windows 2012 servers, I created a public shared folder in my remote server and added to app webservice files to it and in visual studio I changed the publish method to web deploy and filled in the information as below:
Server: https://x.x.x.x/
Site Name: https://x.x.x.x/PublicFolder
Destication URL: https://x.x.x.x/PublicFolder/Application
When I click Validate Connection, it fails with the following message:
Could not connect to the remote computer ("x.x.x.x"). on the remote
computer make sure that Web Deploy is installed and that the required
process ("Web Management Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Unable to connect to the remote server
Note that I tried to replace https with http and I got another error:
Could not connect to the remote computer ("x.x.x.x"). on the remote
computer make sure that Web Deploy is installed and that the required
process ("Web Management Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
the remote server returned an error: (401)Unauthorized
I went to the previous link and I did what they suggested:
Create a separate user group MSDepSvcUsers on remote computer.
Create an local account A on both local & remote computer.
Add A to MSDepSvcUsers on remote computer.
Use account A to publish, this will allow you to publish without
needing to use built-in admin account.
but the same error (NOT_ADMIN) remained
UPDATE: I found another possible solution:
Add/modify windows registery key
“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\”
and set it “1”.
After I added this registry key, the error changed to:
site 'http:' does not exist ... #ERROR_SITE_DOES_NOT_EXIST
So now if I put wrong credentials, I get the unauthorized error, if I use correct credentials I get side does not exist error.
What should I do?
It worked!!
I mean the connection, it's now validated, all I had to do is change site name from "http://x.x.x.x/PublicFolder" to "Default Web Site\SiteName" !!
This was really confusing, finally got it!
I have two EC2 servers. One runs Windows Server 2012 R2 and the other runs on Amazon's Linux build. The Linux box is used as a web server with PHP doing the scripting. I would like the Linux server to send a string to the Windows server every time a PHP file (acting as a RESTful end-point) is processed.
I've never done anything similar and was wondering where to start. From the research I've done so far, it seems like using Netcat to create a Telnet connection might do the job. If so, what would the boilerplate code look like? Netcat is a pretty old platform and there's not much to be found in terms of examples from a Google search.
I am also open to other solutions that could solve this problem.
The workflow of what I am trying to do looks like:
A user hits PHP file end-point -> PHP or the server it runs on sends a string to the Windows Server -> Windows server receives the string and starts a script
You could think of exposing this as an endpoint on your Windows server using either of:
IIS + PHP
IIS + CGi/Perl
IIS + Asp
or anything else.
Expose a simple page on IIS (Windows web server) and hit that from within your webservice login (Linux server) whenever the Linux server receives a request. The script/page that is exposed by your Windows server could execute the desired script then.
The page/endpoint that is exposed on the Windows server should be protected so that not anyone could execute it (disabling public ips. Restricting only the Linux server Ip in your firewall rules etc.)
Sample
Within your php webservice - $my_var = file_get_contents('http://WinServerPrivateIp/runScript.pl'); // Make it asynchronous if needed
runScript.pl in Windows - Would execute your actual script.
You could look at calling winexe from within PHP. I haven't done it myself but I've read that this should do the trick.
winexe Sourceforge
Some sample code from within PHP here
I hope that this is of some help to you
Regards
Liam
I need to develop a minimalistic webservice.
It should have 2 functions:
senduserdata (a remote app will call "senduserdata" to send info about users, like "ID" and "amount")
sendconfirmation (a remote app will tell "all ok for proccess ID=X, notes are: NOTES)
In past I did a SOAP dll that needs IIS to run, since deployment is crucial in my case and IIS is not always available is it possible to have a standalone exe that exposes the SOAP (or REST) interface?
I succeded in a few minutes using the RemObjects trial and setting SOAP as communication protocol in a server + client project group (note: i need server only).
With a VCL EXE i can deploy much easier (i have lots of customers, and accessing their IIS to install a dll it is sometimes too hard).
Yes, you can use any TCP library for Delphi which includes a HTTP server, for example Internet Direct (Indy). With Indy, you can create a stand-alone application (or better, a windows service) without IIS.
In a RESTful web application, the senduserdata command would be implemented by a URL like
http://example.com/api/users
The clients then use a HTTP PUT or PATCH request to update the users resource.
A senduserdate call for user id 774422 would be written like
LStream := TStringStream.Create('{ "amount":100.50, "currency":"EUR" }');
try
HTTP := TIdHTTP.Create;
try
HTTP.Put('http://example.com/api/users/774422', LStream);
finally
HTTP.Free;
end;
finally
LStream.Free;
end;
In the the Delphi application for server side, a TIdHTTPServer component then listens for HTTP requests for the /rest/users resource and in the OnCommandOther event handler it would extract the request body string, parse it, and apply the changes to the user with the ID given in the resource path (/774422).
i have an webserivce written where i do an insertion opertion to DB.
path :http://localhost:1838/Ajax/WebService.asmx?wsdl.name of the webservice is localhost
i have added webservice for the project
now on button click event i try to call this webserice like this
localhost obj= new localhost();
obj.insert();
now i am able to do the insertion operation fine.
but i wanted to create an proxy for the webservice so wat is the use of it doing like tat?
when i run this command in my command prompt in vs
wsdl /out:myProxyClass.cs http://localhost:1838/Ajax/WebService.asmx?WSDL
i get an error
unable to connect the remote server.
no connection would be made because
the target machine actively refused
it
looking forward for an solution any help would great
thank you
It looks like you are using the built in develoment webserver (Cassini). Are you sure it was running when you issued the wsdl command ? The tool needs to connect to the service and download metadata, in order to generate your proxy.
I am trying to call a web service from a BizTalk (2006) orchestration.
Having got the hang of the basics, I have been following this tutorial (page 74 onwards) in which i have a web reference to an external web service (I am using this web service instead of the one in the tutorial), I have my web message in a Send component, and have set up the request / response ports for the web service call.
I'm fairly sure that eveything is set up correctly, but my orchestration fails to call the web service with the following error:
The adapter failed to transmit the message going to send port
"My_Order_Processor.Orchestration-CurrencyConvertPort-36c122f41c5596ae"
with URL "http://www.webservicex/net/CurrencyConvertor.asmx.
WebException: Unable to connect to the remote server.
SocketException: An existing connection was forcibly
closed by the remote host 209.162.186.60:80
The IP 209.162.186.60 is the address for the web service I am trying to connect to. I am trying to narrow down the reasons for the error, e.g.:
Firewall issues
Proxy server issues (I don't know how to configure BizTalk to use a proxy server)
Something else
The BizTalk server can ping the web service, I can access the internet (through IE), I can add the WebReference to the project successfully (meaning at least the orchestration designer can access the web service okay). I have also tried a different web service, with the same result.
Any ideas on finding out why this is happening or how to find out more info? (I'm new to BizTalk)
I've seen this veru vague error before for many different reasons. Two suggestions.
Download something like NetMon and watch what is going on on the wire.
Turn off chunked encoding. For some reason, many web services don't handle this well.
Let us know what you find out.
Could this not be an authentication issue? Check that you can connect to the webservice using the Bts credentials.
This turned out to be a proxy issue.
By navigating to Biz Talk Group -> Platform Settings -> Adapters -> SOAP, I was able to configure the BizTalk server host's SOAP adapter (which is what the web service call uses to make the call) to use our company proxy server correctly. Double click the 'send' SOAP adapter, go to Properties under adapter name.