Salesforce-SOAP接口以及使用SOAP UI测试

69 阅读1分钟

代码简单示例

global without sharing class InvIntegrationToOBSWebService {
    
    webservice static ReturnResult bulkCreateProduct(List<InvProduct> invProductList) {
        .....
    }

    global class InvProduct{
        webservice String name; // 产品名称
        webservice String delivery; // 交货周期
        webservice String family; // 产品系列
        webservice String productFamilyCode; // 产品系列代码
        webservice String productCode; // 产品代码
        webservice String quantityUnitOfMeasure; // 计量单位
        webservice String category1; // 类型1
        webservice String category2; // 类型2
        webservice String category3; // 类型3
        webservice Integer MOQ; // 最小订购量
        webservice Integer MPQ; // 最小包装量
        webservice String description; // 产品描述
        webservice Boolean isActive; // 状态
    }

}

下载企业级wsdl文件

image.png

下载Apex Class的wsdl文件

image.png

image.png 将文件另存到本地

使用SOAPUI测试

image.png 先导入企业级的wsdl文件

image.png

找到login接口,输入用户名密码

image.png

点击左上角的绿色三角箭头

![image.png](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9d5cd98cdbbc427fa4e95112b6e20d7e~tplv-k3u1fbpfcp-watermark.image?)

将sessionId记录在本地,开始测试开发的接口

导入ApexClass的wsdl

image.png

携带SessionId以及请求的参数即可进行测试

image.png