Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Delphi SOAP
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
 
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:
 
function  GetSentMessages(const AccountKey: WideString; const MessageCount: Integer): ArrayOfSMSOutgoingMessage; stdcall;
 
Any Ideas?
Thnx
Posted 26-Apr-13 8:38am
Comments
bawolbri at 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)

  Print Answers RSS
0 OriginalGriff 436
1 Maciej Los 249
2 BillWoodruff 199
3 /\jmot 180
4 Suraj Sahoo | Coding Passion 170
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 26 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100