2010-11-19 2 views
0

Spring.net 웹 서비스를 설정하려고하지만 알아낼 수없는 오류 메시지가 계속 나타납니다.스프링.net 웹 서비스가 작동하려면 어떻게해야합니까?

오류 :

System.NotSupportedException: Target 'target' of type 'Spring.Objects.Factory.Support.RootWebObjectDefinition' does not support methods of 'StudentRegistration.Services.IBoundaryService'. 
    at Spring.Util.AssertUtils.Understands(Object target, String targetName, Type requiredType) 
    at HelloWorldExporter.GetAllBounds() 

코드 :

public interface IBoundaryService { 
     XmlDocument GetAllBounds(); 
    } 

    public class BoundaryService :IBoundaryService 
    { 
     public virtual IBoundaryDao BoundaryDao { get; set; } 

     public virtual XmlDocument GetAllBounds() 
     { 
      XmlDocument xmlDoc = new XmlDocument(); 
      xmlDoc.LoadXml("<test>ok</test>"); 
      return xmlDoc; 
     } 
    } 

구성 :

<object name="BoundaryService" type="StudentRegistration.Services.BoundaryService, StudentRegistration" 
     abstract="true"> 
    </object> 

    <object id="BoundaryExporter" type="Spring.Web.Services.WebServiceExporter, Spring.Web"> 
    <property name="TargetName" value="BoundaryService"/> 
    <property name="Namespace" value="http://fake/services"/> 
    <property name="Description" value="something"/> 
    <property name="MemberAttributes"> 
     <dictionary> 
     <entry key="GetAllBounds"> 
      <object type="System.Web.Services.WebMethodAttribute, System.Web.Services"> 
      <property name="Description" value="something."/> 
      <property name="MessageName" value="GetAllBounds"/> 
      </object> 
     </entry> 
     </dictionary> 
    </property> 
    </object> 

내가 이것을 정리 무엇을하려고 하는가?

답변

2

XML.NET 선언에 대한 Spring.NET 참조가 잘못되었습니다 (몇 일 전에 동일한 문제가 있었음).

<object name="BoundaryService" 
     type="StudentRegistration.Services.BoundaryService, StudentRegistration" 
     abstract="true" /> 

당신이

당신이 Spring.Web.Services.WebServiceExporter를 사용하여 WebService에로 내보낼 PONO있을 때 내보낼 개체를 선언해야 실제 .asmx 서비스에게이있을 때 위의 선언이 적용되는 :

<object id="BoundaryService" 
     type="StudentRegistration.Services.BoundaryService, StudentRegistration" 
/> 

WebServiceExporter의 target 속성은 선언 된 객체의 id에 적용됩니다. 추상 부분은 필요하지 않습니다. Spring.NET이 웹 서비스. (현재 CFG와) 당신의 노출 서비스 이름이 될 것입니다

(..)/BoundaryExporter.asmx

편집 : 이름, 유형 속성을 사용하여 표준이 .asmx 웹 서비스에 대한 설정 문이 보인다 는 적어도 파괴한다 봄 버전 1.3.0.20349