Код метода webservice следующий (полезный код я выкинул, ибо он сейчас и не выполняется. Я пытаюсь банально вернуть входящий параметр)
/// <summary>
/// Авторизация
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <returns></returns>
[WebMethod(Description = "Авторизация")]
public string GetAuthorizationTicket(int inParam)
// public string GetAuthorizationTicket(string userName, string password)
{
string message = Convert.ToString(inParam);
return "Параметры: " + message;
}
Вот код сгенеренный импортером
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://localhost:3677/WebService/AuthService.asmx?wsdl
// Encoding : utf-8
// Version : 1.0
// (19.10.2006 22:14:07 - 1.33.2.5)
// ************************************************************************ //
unit AuthService;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:int - "http://www.w3.org/2001/XMLSchema"
// !:string - "http://www.w3.org/2001/XMLSchema"
// ************************************************************************ //
// Namespace : http://localhost:3677/webservice
// soapAction: http://localhost:3677/webservice/GetAuthorizationTicket
// transport : http://schemas.xmlsoap.org/soap/http
// binding : AuthServiceSoap
// service : AuthService
// port : AuthServiceSoap
// URL : http://localhost:3677/WebService/AuthService.asmx
// ************************************************************************ //
AuthServiceSoap = interface(IInvokable)
['{616637E9-8425-B3E1-37E4-3FBBB1901351}']
function GetAuthorizationTicket(const inParam: Integer): WideString; stdcall;
end;
function GetAuthServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): AuthServiceSoap;
implementation
function GetAuthServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): AuthServiceSoap;
const
defWSDL = 'http://localhost:3677/WebService/AuthService.asmx?wsdl';
defURL = 'http://localhost:3677/WebService/AuthService.asmx';
defSvc = 'AuthService';
defPrt = 'AuthServiceSoap';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as AuthServiceSoap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(AuthServiceSoap), 'http://localhost:3677/webservice', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(AuthServiceSoap), 'http://localhost:3677/webservice/GetAuthorizationTicket');
end.
Меня смущает SOAP сообщение, которое отправляет дельфи при вызове метода.