You've already forked lazarus-ccr
Name space declared in parent nodes must be available to child node : for target name extracting; Thanks to Shaun Simpson.
+ update + test case git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@479 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -147,10 +147,7 @@ begin
|
|||||||
FCallProcedureName := ExtractNamePart(s);
|
FCallProcedureName := ExtractNamePart(s);
|
||||||
If IsStrEmpty(FCallProcedureName) Then
|
If IsStrEmpty(FCallProcedureName) Then
|
||||||
Error('No Method name.');
|
Error('No Method name.');
|
||||||
tmpNode := mthdNd.Attributes.GetNamedItem(sXML_NS + ':' + nsShortName);
|
FCallTarget := FindAttributeByNameInScope(sXML_NS + ':' + nsShortName);
|
||||||
If Not Assigned(tmpNode) Then
|
|
||||||
Error('Call target attribute not found.');
|
|
||||||
FCallTarget := tmpNode.NodeValue;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSOAPFormatter.GetCallProcedureName(): String;
|
function TSOAPFormatter.GetCallProcedureName(): String;
|
||||||
|
@ -517,6 +517,12 @@ type
|
|||||||
procedure Assign();
|
procedure Assign();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TTest_SoapFormatterServerNameSpace }
|
||||||
|
|
||||||
|
TTest_SoapFormatterServerNameSpace = class(TTestCase)
|
||||||
|
published
|
||||||
|
procedure namespace_declared_env();
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses base_binary_formatter, base_soap_formatter, base_xmlrpc_formatter, record_rtti,
|
uses base_binary_formatter, base_soap_formatter, base_xmlrpc_formatter, record_rtti,
|
||||||
@ -4173,6 +4179,42 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TTest_SoapFormatterServerNameSpace }
|
||||||
|
|
||||||
|
procedure TTest_SoapFormatterServerNameSpace.namespace_declared_env();
|
||||||
|
const
|
||||||
|
XML_SOURCE =
|
||||||
|
'<soapenv:Envelope ' + sLineBreak +
|
||||||
|
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' + sLineBreak +
|
||||||
|
'xmlns:hfp="hfpax"> ' + sLineBreak +
|
||||||
|
' <soapenv:Header/> ' + sLineBreak +
|
||||||
|
' <soapenv:Body> ' + sLineBreak +
|
||||||
|
' <hfp:GetVersion/> ' + sLineBreak +
|
||||||
|
' </soapenv:Body> ' + sLineBreak +
|
||||||
|
'</soapenv:Envelope>';
|
||||||
|
var
|
||||||
|
f : IFormatterResponse;
|
||||||
|
strm : TMemoryStream;
|
||||||
|
strBuffer : ansistring;
|
||||||
|
cctx : ICallContext;
|
||||||
|
begin
|
||||||
|
f := server_service_soap.TSOAPFormatter.Create() as IFormatterResponse;
|
||||||
|
strm := TMemoryStream.Create();
|
||||||
|
try
|
||||||
|
strBuffer := XML_SOURCE;
|
||||||
|
strm.Write(strBuffer[1],Length(strBuffer));
|
||||||
|
strm.Position := 0;
|
||||||
|
f.LoadFromStream(strm);
|
||||||
|
cctx := TSimpleCallContext.Create() as ICallContext;
|
||||||
|
f.BeginCallRead(cctx);
|
||||||
|
strBuffer := f.GetCallProcedureName();
|
||||||
|
CheckEquals('GetVersion',strBuffer, 'GetCallProcedureName()');
|
||||||
|
f.EndScopeRead();
|
||||||
|
finally
|
||||||
|
FreeAndNil(strm);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterStdTypes();
|
RegisterStdTypes();
|
||||||
GetTypeRegistry().Register(sXSD_NS,TypeInfo(TTestEnum),'TTestEnum').RegisterExternalPropertyName('teOne', '1');
|
GetTypeRegistry().Register(sXSD_NS,TypeInfo(TTestEnum),'TTestEnum').RegisterExternalPropertyName('teOne', '1');
|
||||||
@ -4237,5 +4279,5 @@ initialization
|
|||||||
RegisterTest('Serializer',TTest_XmlRpcFormatterExceptionBlock.Suite);
|
RegisterTest('Serializer',TTest_XmlRpcFormatterExceptionBlock.Suite);
|
||||||
RegisterTest('Serializer',TTest_BinaryFormatterExceptionBlock.Suite);
|
RegisterTest('Serializer',TTest_BinaryFormatterExceptionBlock.Suite);
|
||||||
RegisterTest('Serializer',TTest_TStringBufferRemotable.Suite);
|
RegisterTest('Serializer',TTest_TStringBufferRemotable.Suite);
|
||||||
|
RegisterTest('Serializer',TTest_SoapFormatterServerNameSpace.Suite);
|
||||||
end.
|
end.
|
||||||
|
Reference in New Issue
Block a user