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

     

     

  • 相关阅读:
    ERP类系统设计学习
    人工智能关键词
    系统性能
    连接不同服务器不同数据库
    socket一个例子
    SQLite
    asp.net 页面缓存、数据缓存
    原生js
    Android 网络调试 adb tcpip 开启方法
    C语言中string char int类型转换
  • 原文地址:https://www.cnblogs.com/dingkui/p/4125270.html
Copyright © 2011-2022 走看看