diff --git a/wst/trunk/server_service_soap.pas b/wst/trunk/server_service_soap.pas index 2fe5d150c..9d70b32f7 100644 --- a/wst/trunk/server_service_soap.pas +++ b/wst/trunk/server_service_soap.pas @@ -147,10 +147,7 @@ begin FCallProcedureName := ExtractNamePart(s); If IsStrEmpty(FCallProcedureName) Then Error('No Method name.'); - tmpNode := mthdNd.Attributes.GetNamedItem(sXML_NS + ':' + nsShortName); - If Not Assigned(tmpNode) Then - Error('Call target attribute not found.'); - FCallTarget := tmpNode.NodeValue; + FCallTarget := FindAttributeByNameInScope(sXML_NS + ':' + nsShortName); end; function TSOAPFormatter.GetCallProcedureName(): String; diff --git a/wst/trunk/tests/test_suite/testformatter_unit.pas b/wst/trunk/tests/test_suite/testformatter_unit.pas index d5a22529a..14c1cd1c0 100644 --- a/wst/trunk/tests/test_suite/testformatter_unit.pas +++ b/wst/trunk/tests/test_suite/testformatter_unit.pas @@ -517,6 +517,12 @@ type procedure Assign(); end; + { TTest_SoapFormatterServerNameSpace } + + TTest_SoapFormatterServerNameSpace = class(TTestCase) + published + procedure namespace_declared_env(); + end; implementation uses base_binary_formatter, base_soap_formatter, base_xmlrpc_formatter, record_rtti, @@ -4173,6 +4179,42 @@ begin end; end; +{ TTest_SoapFormatterServerNameSpace } + +procedure TTest_SoapFormatterServerNameSpace.namespace_declared_env(); +const + XML_SOURCE = + ' ' + sLineBreak + + ' ' + sLineBreak + + ' ' + sLineBreak + + ' ' + sLineBreak + + ' ' + sLineBreak + + ''; +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 RegisterStdTypes(); GetTypeRegistry().Register(sXSD_NS,TypeInfo(TTestEnum),'TTestEnum').RegisterExternalPropertyName('teOne', '1'); @@ -4237,5 +4279,5 @@ initialization RegisterTest('Serializer',TTest_XmlRpcFormatterExceptionBlock.Suite); RegisterTest('Serializer',TTest_BinaryFormatterExceptionBlock.Suite); RegisterTest('Serializer',TTest_TStringBufferRemotable.Suite); - + RegisterTest('Serializer',TTest_SoapFormatterServerNameSpace.Suite); end.