zoukankan      html  css  js  c++  java
  • Consuming a Web Service in AX 2012

    Consuming a Web Service in AX 2012

    在AX2012版本中如果想调用外部的Web Service变得非常容易。

    第一步,在VS中创建一个Web Service并发布

    第二步,创建一个Class Library,并将创建的Web Services引用到该类库当中,并ADD to AOD中

    第三步,用JOB调用该Web Services,运行Job

    static void KimConsumeWebService(Args _args)
    {
        ClassLibrary1.Class1                                    webService;
        ClassLibrary1.ServiceReference1.WebService1SoapClient   clients;
        System.ServiceModel.Description.ServiceEndpoint         endPoint; 
        System.ServiceModel.EndpointAddress                     endPointAddress;
        System.Type                                             type;
        System.Exception                                        ex; 
        ;
        try
        {
            type            = CLRInterop::getType('ClassLibrary1.ServiceReference1.WebService1SoapClient'); 
            clients         = AifUtil::createServiceClient(type);
            print clients.Kim();
            pause;
        }
        catch(Exception::CLRError) 
        { 
            ex = CLRInterop::getLastException(); 
      
            while(ex) 
            { 
                info(CLRInterop::getAnyTypeForObject(ex.ToString())); 
                ex = ex.get_InnerException(); 
            } 
        } 
    }

     

     

  • 相关阅读:
    Linux命令之_Cut(转)
    Use “error_messages” in Rails 3.2? (raises “undefined method” error)
    ruby错误
    Linux SvN操作
    Linux 安装SVN服务器 (转)
    删除 vim 命令
    vscode 配置java开发
    java json
    svn
    采样率和比特率
  • 原文地址:https://www.cnblogs.com/dingkui/p/4125270.html
Copyright © 2011-2022 走看看