Witam!
Próbuję połączyć się z WebServisem przez SOAP i HTTPRIO. Pomyślnie zaimportowałem plik WSDL przy pomocy WSDL Importera, który stworzył mi prawidłowe definicje metod, funkcji i zmiennych. Gdy przy pomocy poniższego kodu próbuję odwołać się do pierwszej wymaganej funkcji (autentykacja użytkownika) dostaję komunikat jak w temacie. HTTPRIO ma przypisany właściwy odnośnik do pliku WSDL (WSDLLocation), prawidłowy serwis (Service) i port. Oto kod:
procedure TForm2.Button1Click(Sender: TObject);
var
AuthReq: AuthenticateRequest;
AuthResp: AuthenticateResponse;
DossReq: getDossierRequest;
DossResp: GetDossierResponse;
IPI: IProxyIntegration_v1_2;
begin
IPI := HTTPRio as IProxyIntegration_v1_2;
AuthReq:=AuthenticateRequest.Create;
AuthResp:=AuthenticateResponse.Create;
DossReq:=getDossierRequest.Create;
DossResp:=GetDossierResponse.Create;
try
try
AuthReq.username:='username';
AuthReq.password:='password';
AuthResp:=IPI.authenticate(AuthReq); //tutaj program się wysypuje komunikatem o nieprawidłowym XML
if AuthResp.status=100 then
begin
DossReq.dossierId:=StrToInt(edit1.Text);
DossReq.authenticateData:=AuthResp.authenticateData;
DossResp:=IPI.getDossier(DossReq);
end
else
ShowMessage(IntToStr(AuthResp.status));
except
on E: Exception do
ShowMessage(E.Message);
end;
finally
AuthReq.Free;
AuthResp.Free;
DossReq.Free;
DossResp.Free;
end;
end;
Co może być przyczyną? Czegoś mi jeszcze brakuje w tym kodzie?
PS: jestem świeży jeśli chodzi o SOAP pod Delphi, ale generalnie w środowisku już dużo programuję.