soozh
asked on
Calling a web service in Delphi 2010
Hello,
I have been given some C# code that demostrates how to acess a web service. I want to make the call in Delphi. I have imported the wsdl etc into my project however I do not know what the "theProxy.ClientCredential s" are and how to set them in Delphi 2010.
the wsdl is: https://eurequo.integration-ag.eu/WebService/FormWebService.svc
Can someone help out here?
I have been given some C# code that demostrates how to acess a web service. I want to make the call in Delphi. I have imported the wsdl etc into my project however I do not know what the "theProxy.ClientCredential
the wsdl is: https://eurequo.integration-ag.eu/WebService/FormWebService.svc
Can someone help out here?
//instantiate proxy
using (EUREQUO_Webservice.FormWebServiceClient theProxy = new EUREQUO_Webservice.FormWebServiceClient())
{
//add username and password
theProxy.ClientCredentials.UserName.UserName = tbUsername.Text;
theProxy.ClientCredentials.UserName.Password = tbPassword.Text;
//call webservice (sync)
tbResult.Text = theProxy.processForm(tbControlXml.Text, tbDataXml.Text);
}
}
check https://www.experts-exchange.com/questions/25026609/Delphi-2010-consuming-a-web-service.html
ASKER
Hello,
i appreciate your comment but if you look a bit closer you will see that you have pointed me to a question i myself asked sometime ago. (which I also found the solution too.)
And importantly it does not answer my new question.
You know you really have to work a bit harder to get the points.
/R
i appreciate your comment but if you look a bit closer you will see that you have pointed me to a question i myself asked sometime ago. (which I also found the solution too.)
And importantly it does not answer my new question.
You know you really have to work a bit harder to get the points.
/R
this post might be helpful: http://conferences.embarcadero.com/article/32219
ASKER
That technical articule refers to .Net and I am using RAD 2010 which is WIn32.
This problem is a pretty straight forward for someone who knows about web service credentials and consuming web services in win32.
This problem is a pretty straight forward for someone who knows about web service credentials and consuming web services in win32.
You could use the HTTPRIO1.HTTPWebNode.Proxy to set the proxy information.
ASKER
I have tried everything... even had some other experts to try... but no one seems to be able to get a Delphi Rad 2010, or a Delphi Prism app to talk to this web service.... not sure if it has anything to do with the soap version... or c# web services.... but it does not seem to work....
Do you have actual credtial values I can try? Otherwise, you can try the following code which sets the proxy credentials in the HTTPWebNode, like I suggested earlier:
procedure TExpertExchangeForm.Button1Click(Sender: TObject);
var
Proxy: IFormWebService;
Result: String;
begin
HTTPRIO1.HTTPWebNode.UserName := 'username';
HTTPRIO1.HTTPWebNode.Password := 'password';
Proxy := GetIFormWebService(False, '', HTTPRIO1);
Proxy.
try
Result := Proxy.processForm(tbControlXml.Text, tbDataXml.Text);
ShowMessage(Result);
except
on Ex: Exception do
ShowMessage(Ex.ClassName + ': ' + Ex.Message);
end
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I still believe you can set the user credentials using a HTTPRIo, but if you are not able to try that with your web service, I cannot help you...
HTTPRIO1.HTTPWebNode.UserN ame := 'username';
HTTPRIO1.HTTPWebNode.Passw ord := 'password';
Proxy := GetIFormWebService(False, '', HTTPRIO1);
Do you have valid username and password combinations that can be tried?
HTTPRIO1.HTTPWebNode.UserN
HTTPRIO1.HTTPWebNode.Passw
Proxy := GetIFormWebService(False, '', HTTPRIO1);
Do you have valid username and password combinations that can be tried?
Too bad that you gave up on this. Oh well...