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(); 
            } 
        } 
    }

     

     

  • 相关阅读:
    MYsql 之单标查询.
    MYSQL社区版安装手册
    爬虫框架学习
    celery_消息队列
    rabbitMQ消息队列
    Django分页设置
    Mysql-基础+安装指南
    super函数的用法
    hashlib 和loggin模块
    Python的魔法方法
  • 原文地址:https://www.cnblogs.com/dingkui/p/4125270.html
Copyright © 2011-2022 走看看