You've already forked lazarus-ccr
fix wsdl operation attributes parsing when there are multiple attributes : unit test.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1243 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
39
wst/trunk/tests/test_suite/files/soap_action.wsdl
Normal file
39
wst/trunk/tests/test_suite/files/soap_action.wsdl
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions name="library1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="urn:test">
|
||||
<types>
|
||||
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:test" targetNamespace="urn:test"/>
|
||||
</types>
|
||||
<message name="test_proc">
|
||||
<part name="AConstParam" type="xsd:string"/>
|
||||
</message>
|
||||
<message name="test_procResponse">
|
||||
<part name="AOutParam" type="xsd:boolean"/>
|
||||
<part name="AResParam" type="xsd:int"/>
|
||||
</message>
|
||||
<portType name="TestService">
|
||||
<document>
|
||||
<GUID value="{2E64ADA6-BF3F-4C88-89BF-17709416B11C}"/>
|
||||
</document>
|
||||
<operation name="test_proc">
|
||||
<input message="tns:test_proc"/>
|
||||
<output message="tns:test_procResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="TestServiceBinding" type="tns:TestService">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="test_proc">
|
||||
<soap:operation soapAction="http://wst.Sample/Soap/Action/"/>
|
||||
<input>
|
||||
<soap:body use="literal" namespace="library1"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal" namespace="library1"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="TestService">
|
||||
<port name="TestServicePort" binding="tns:TestServiceBinding">
|
||||
<soap:address location=""/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
@ -198,6 +198,7 @@ type
|
||||
procedure message_parts_type_hint();
|
||||
procedure parameter_var();
|
||||
procedure parameter_const_default();
|
||||
procedure soap_action();
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -2665,6 +2666,38 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTest_WsdlParser.soap_action();
|
||||
var
|
||||
tr : TwstPasTreeContainer;
|
||||
elt : TPasElement;
|
||||
intf : TPasClassType;
|
||||
i : Integer;
|
||||
mth : TPasProcedure;
|
||||
begin
|
||||
tr := ParseDoc('soap_action');
|
||||
try //SymbolTable.Properties.SetValue(AOp,s_TRANSPORT + '_' + s_soapAction,nd.NodeValue);
|
||||
elt := tr.FindElement('TestService');
|
||||
CheckNotNull(elt,'TestService');
|
||||
CheckIs(elt,TPasClassType);
|
||||
intf := elt as TPasClassType;
|
||||
mth := nil;
|
||||
for i := 0 to (intf.Members.Count - 1) do begin
|
||||
if TObject(intf.Members[i]).InheritsFrom(TPasProcedure) then begin
|
||||
mth := TPasProcedure(intf.Members[i]);
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
CheckNotNull(mth,'test_proc not found');
|
||||
CheckEquals('test_proc',mth.Name);
|
||||
CheckEquals(
|
||||
'http://wst.Sample/Soap/Action/',
|
||||
tr.Properties.GetValue(mth,s_TRANSPORT + '_' + s_soapAction)
|
||||
);
|
||||
finally
|
||||
tr.Free();
|
||||
end;
|
||||
end;
|
||||
|
||||
function TTest_WsdlParser.LoadComplexType_Class_default_values() : TwstPasTreeContainer;
|
||||
begin
|
||||
Result := ParseDoc(x_complexType_class_default);
|
||||
|
Reference in New Issue
Block a user