Hi, I guess I found the reason ...
http://www.bobswart.nl/weblog/Blog.aspx?RootId=5:798 Thanks anyway! Rodney Chan -----Original Message----- From: Rodney Chan [mailto:rc...@compuspec.com] Sent: Thursday, 12 May 2011 1:13 p.m. To: 'delphi@delphi.org.nz' Subject: Delphi 6 Webservices WSDL import I try to create a weather webservices client, follow the tutorial: http://www.devarticles.com/c/a/Delphi-Kylix/Creating-a-Web-Service-Client-wi th-Delphi/ but it does not work. The soap request is: <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><NS1:GetW eatherByZipCode xmlns:NS1="http://www.webservicex.net"><ZipCode xsi:type="xsd:string">30350</ZipCode></NS1:GetWeatherByZipCode></SOAP-ENV:Bo dy></SOAP-ENV:Envelope> And the header of the soap response is: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultco de>soap:Server</faultcode><faultstring>System.Web.Services.Protocols.SoapExc eption: Server was unable to process request. ---> System.Exception: Error occured when get webservices record ---> System.Data.SqlClient.SqlException: Procedure or function 'GetLatByZipCode' expects parameter '@zipCode', which was not supplied. Seems like I missed the zipCode parameter but it is already in the header. After comparing the imported WSDL with the example on the web, I found that the following line is missed in my imported unit: InvRegistry.RegisterInvokeOptions(TypeInfo(WeatherForecastSoap), ioDocument); After adding it, the project works. I just wonder if I missed anything during the import process. I already have D6 update 1,2 and RTL 1-3. And I would to have the import working with other web services. I also tried D7 and the same problem occur. Thanks in advance! Rodney Chan _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: unsubscribe