日期:2014-05-17 浏览次数:20843 次
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public object InvokeClass()
{
return Assembly.Load("BUSINNESS").CreateInstance("BUSINNESS.Test1");//之后做成配置
}
}
localhost.WebService1 w = new localhost.WebService1();//返回服务端WEBSERVICE对象
IDAL.ITest t = (IDAL.ITest)w.InvokeClass();//获取ITest业务逻辑对象 此处报错!
using System.Web.Services;
using System.ComponentModel;
using LY.TEC.Framework.Common.Container;
using LY.TEC.WSCommunication;
namespace LY.TEC.Framework.WebService
{
/// <summary>
/// CurrencyService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class CurrencyService : System.Web.Services.WebService
{
[WebMethod(EnableSession = true)]
public object[] MethodInvoke(object[] objArr)
{
IIOCContainer container = ContainerContext.Container;
IInvokeServerComponent invokeComponent = container.Resolve<IInvokeServerComponent>();
object[] objArrReturn = in