Имя: Пароль:
IT
 
Delphi и веб-сервисы
0 Dagmanor
 
02.08.13
18:22
Всем доброго времени суток!
Помогите, пожалуйста, решить проблему.
Есть небольшой веб-сервис. Вот его wsdl:

<?xml version ="1.0" encoding ="UTF-8" ?>
<wsdl:definitions
   name="vaphoto"
   xmlns:tns="urn:vaphoto"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
   xmlns:xsd="http://www.w3.org/2001/XMLSchema";
   targetNamespace="urn:vaphoto">
  
   <wsdl:types>
      <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; targetNamespace="urn:vaphoto">
         <xsd:element name="param_1" type="xs:string" />
         <xsd:element name="param_2" type="xs:string" />
         <xsd:element name="Result" type="xs:string" />
      </xsd:schema>
   </wsdl:types>

   <wsdl:message name="getFileListRequest">
      <wsdl:part name="dir" element="tns:param_1" />
      <wsdl:part name="partcode" element="tns:param_2" />
   </wsdl:message>
   <wsdl:message name="getFileListResponse">
      <wsdl:part name="Result" type="xs:string" />
   </wsdl:message>
   <wsdl:portType name="vaphotoPortType">
      <wsdl:operation name="getFileList">
         <wsdl:input message="tns:getFileListRequest" ></wsdl:input>
         <wsdl:output message="tns:getFileListResponse" />
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="vaphotoBinding" type="tns:vaphotoPortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"; />
      <wsdl:operation name="getFileList">
         <soap:operation soapAction="urn:vaphoto/getFileList" />
         <wsdl:input>
            <soap:body use="literal" />
         </wsdl:input>
         <wsdl:output>
            <soap:body use="literal" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="vaphotoService">
      <wsdl:port name="vaphotoPort" binding="tns:vaphotoBinding">
         <soap:address location="http://catalog.тра-ля-ля.com/тра-ля-ля.php"; />
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>


Пытаюсь втянуть wsdl-ссылку в[B] Delphi 2010[/B] через WSDL-Importer (File->New->WSDL-Importer).
Втянутый в Delphi сервис выглядит так:

//************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
//
// Encoding : UTF-8
// Version  : 1.0
// (02.08.2013 17:07:34 - - $Rev: 24171 $)
// ************************************************************************ //

unit vaphoto;

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 Embarcadero types; however, they could also
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"[Lit][Gbl]
  // !:string          - ""[Lit][]

  param_1         =  type string;      { "urn:vaphoto"[Lit][GblElm] }
  param_2         =  type string;      { "urn:vaphoto"[GblElm] }

  // ************************************************************************ //
  // Namespace : urn:vaphoto
  // soapAction: urn:vaphoto/getFileList
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : vaphotoBinding
  // service   : vaphotoService
  // port      : vaphotoPort
  // URL       : http://catalog.тра-ля-ля.com/тра-ля-ля.php
  // ************************************************************************ //
  vaphotoPortType = interface(IInvokable)
  ['{BCC8D094-20D9-D36C-1801-68DAD324A546}']

    // Cannot unwrap:
    //     - Input message has more than one part
    //     - Output part does not refer to an element
    function  getFileList(const dir: param_1; const partcode: param_2): string; stdcall;
  end;

function GetvaphotoPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): vaphotoPortType;


implementation
  uses SysUtils;

function GetvaphotoPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): vaphotoPortType;
const
  defWSDL = 'http://catalog.тра-ля-ля.com/тра-ля-ля.wsdl';
  defURL  = 'http://catalog.тра-ля-ля.com/тра-ля-ля.php';
  defSvc  = 'vaphotoService';
  defPrt  = 'vaphotoPort';
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 vaphotoPortType);
    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(vaphotoPortType), 'urn:vaphoto', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(vaphotoPortType), 'urn:vaphoto/getFileList');
  InvRegistry.RegisterInvokeOptions(TypeInfo(vaphotoPortType), ioDocument);
  InvRegistry.RegisterInvokeOptions(TypeInfo(vaphotoPortType), ioLiteral);
  RemClassRegistry.RegisterXSInfo(TypeInfo(param_1), 'urn:vaphoto', 'param_1');
  RemClassRegistry.RegisterXSInfo(TypeInfo(param_2), 'urn:vaphoto', 'param_2');

end.

Вроде бы все нормально втягивается , но при попытке вызвать метод веб-сервиса получаю ошибку:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class ERemotableException with message 'Procedure 'param_1' not present'.

Что я делаю не так? Уже весь мозг сломал.....
1 Xapac
 
02.08.13
18:26
интересно, кто-нибудь это прочитает полностью
2 Dagmanor
 
02.08.13
18:36
Забыл написать, в SoapUI все работает нормально...
3 Dagmanor
 
02.08.13
19:03
UP
4 Dagmanor
 
05.08.13
16:12
Актуально
5 Bugmenot
 
05.08.13
16:16
Буду первым: делфи не нужно. Используй C#
6 Dagmanor
 
05.08.13
16:33
(5) На чем писать выбираю не я. И вопрос не в том нужно ли Делфи или нет.
7 Dagmanor
 
05.08.13
16:41
Товарищи программисты, неужели никто не хочет помочь?
8 Жан Пердежон
 
05.08.13
16:54
самому загуглить никак?
http://www.delphisources.ru/pages/faq/base/web_services.html
9 Кирпич
 
05.08.13
16:57
(0) форумом ошиблись, товарищ.
10 Bugmenot
 
06.08.13
14:16
(6) - и открой для себя наконец то pastebin!