Skip to content

Instantly share code, notes, and snippets.

@spockz
Created January 13, 2012 07:47
Show Gist options
  • Save spockz/1605032 to your computer and use it in GitHub Desktop.
Save spockz/1605032 to your computer and use it in GitHub Desktop.
---------------------------
Debugger Exception Notification
---------------------------
Project WSDLtest.exe raised exception class ESOAPDomConvertError with message 'SOAP Response Packet: element matching function return not found, received "<value xmlns="http://schemas.xmlsoap.org/soap/envelope/">Hello world</value>"'.
---------------------------
Break Continue Help
---------------------------
<?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 xmlns:NS1="urn:WashOut" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:concat>
<a xsi:type="xsd:string">Hello </a>
<b xsi:type="xsd:string">world</b>
</NS1:concat>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0"?>
<Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<value>Hello world</value>
</Body>
</Envelope
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://192.168.213.151:3000/api/wsdl
// >Import : http://192.168.213.151:3000/api/wsdl>0
// Encoding : UTF-8
// Codegen : [wfMapStringsToWideStrings+, wfMapArraysToClasses+, wfUseSettersAndGetters+]
// Version : 1.0
// (10-1-2012 11:43:51 - - $Rev: 37707 $)
// ************************************************************************ //
unit wsdl;
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"[]
// !:integer - "http://www.w3.org/2001/XMLSchema"[]
// ************************************************************************ //
// Namespace : urn:WashOut
// soapAction: %operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// use : encoded
// binding : api_binding
// service : service
// port : api_port
// URL : http://192.168.213.151:3000/api/action?controller=api
// ************************************************************************ //
api_port = interface(IInvokable)
['{C52E5D58-7FF5-ACA3-DA20-9665F8B6E085}']
function integer_to_string(const value: Int64): WideString; stdcall;
function concat(const a: WideString; const b: WideString): WideString; stdcall;
end;
function Getapi_port(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): api_port;
implementation
uses SysUtils;
function Getapi_port(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): api_port;
const
defWSDL = 'http://192.168.213.151:3000/api/wsdl';
defURL = 'http://192.168.213.151:3000/api/action?controller=api';
defSvc = 'service';
defPrt = 'api_port';
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 api_port);
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
{ api_port }
InvRegistry.RegisterInterface(TypeInfo(api_port), 'urn:WashOut', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(api_port), '%operationName%');
InvRegistry.RegisterReturnParamNames(TypeInfo(api_port), 'value');
end.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:typens="urn:WashOut" targetNamespace="urn:WashOut" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema targetNamespace="urn:WashOut">
</xsd:schema>
</types>
<message name="integer_to_string">
<part name="value" type="xsd:integer"/>
</message>
<message name="integer_to_string_response">
<part name="value" type="xsd:string"/>
</message>
<message name="concat">
<part name="a" type="xsd:string"/>
<part name="b" type="xsd:string"/>
</message>
<message name="concat_response">
<part name="value" type="xsd:string"/>
</message>
<portType name="api_port">
<operation name="integer_to_string">
<input message="typens:integer_to_string"/>
<output message="typens:integer_to_string_response"/>
</operation>
<operation name="concat">
<input message="typens:concat"/>
<output message="typens:concat_response"/>
</operation>
</portType>
<binding name="api_binding" type="typens:api_port">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="integer_to_string">
<soap:operation soapAction="integer_to_string"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</output>
</operation>
<operation name="concat">
<soap:operation soapAction="concat"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</output>
</operation>
</binding>
<service name="service">
<port name="api_port" binding="api_binding">
<soap:address location="http://localhost:3000/api/action?controller=api"/>
</port>
</service>
</definitions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment