Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I’m trying to connect to the Soap service of SMSGateway.ca to retrieve the list of the last sent messages using Delphi 7 without any success. I’m able to get the WSDL definition from the server using ‘http://www.smsgateway.ca/sendsms.asmx?WSDL’ as an address , but when trying to access the service functionalities I get the Error: “Server was unable to process request. --- Value cannot be null. Parameter name: key.
I’m using a component HTTPRIO (SOAPHTTPClient) to get the service, with:
Port: SendSMSSoap
Service:SendSMS
WSDLLocation: http://www.smsgateway.ca/sendsms.asmx?WSDL

Delphi
procedure TForm1.Button6Click(Sender: TObject);
var
  MyService: SendSMSSoap; //declare a service
  OutMsgs: ArrayOfSMSOutgoingMessage;
  i: integer;
  ke: WideString;

begin
  MyService := HTTPRIO1 as SendSMSSoap; //create the service

  MyOutgoingMsg := SMSOutgoingMessage.Create;

  SetLength(OutMsgs, 3);

  for i := 0 to 2 do
  begin
    OutMsgs[i] := SMSOutgoingMessage.Create;
  end;


  i := 3;
  ke := 'KeySOMETHING'; // Account key
  OutMsgs := MyService.GetSentMessages(vari, i);

end;

WSDLLocation: http://www.smsgateway.ca/sendsms.asmx?WSDLth
The declaration of the function that I get from the interface SendSMSSoap is this:

Delphi
function  GetSentMessages(const AccountKey: WideString; const MessageCount: Integer): ArrayOfSMSOutgoingMessage; stdcall;


Any Ideas?
Thnx
Posted
Comments
frassinoro 31-May-13 18:53pm    
I don't see where you are declaring 'vari', which you are passing into your GetSentMessages function call.

I'm currently working on a similar problem and was able to use the application "soapUI" to test the SOAP calls to my web service, for some reason my SOAP call is passing all of the params across to my web service however the web service did not "see" the parameters having values when the service was invoked. The problem was that my parameter nodes in my SOAP request did not have a namespace defined, I fixed that by using a String Replace function on my nodes (based on posts I've seen around the 'net) and manually adding the namespace to the parameter nodes... now the SOAP call being generated in my Delphi 7 code works fine when I paste it into soapUI, however it is still not working in my Delphi 7 client.

In summary I guess first you need to pass in the proper variable to your function, then from there debug your HTTPRIO object (I'm using the "BeforeExecute" method to both debug and perform my string-replace functionality to apply namespaces to my SOAP nodes.)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900