最详细的使用soapui消费Web service的教程

本文就以SAP Cloud for Customer的web service消费这个需求为例,来讲解soapui这个工具的使用步骤。

使用soapui消费web service,最简单的方式是在soapui里直接导入web service的WSDL文件。

为此,我们需要先拿到SAP C4C标准web service的WSDL文件。

1. Go to workcenter Administrator, then Input and Output management->Service Explorer, you can get a list of all standard inbound services here.

在administator工作中心的input and output management里找到想消费的web service:

点击超链接,把它的WSDL文件下载下来。

If you are working in 1605, you can find a list of all standard web services from SAP help:

Since I would like to query Opportunity data, I choose QueryOpportunityIn, and click Show full documentation:

The documentation tells me how to fill the request detail in SoapUI.

2. Download and install SoapUI. Create a new SOAP project by loading the WSDL downloaded from previous step.

下载安装soapui,此处导入第一步下载的WSDL文件。

Suppose I would like to retrieve this opportunity data in my C4C system by querying its id:

Of source this example might not make much sense from business perspective as in real world we tend to use other criteria like customer name to query Opportunity.

Paste the following xml source code in request view to query on Opportunity 15360.

把下列的XML字符串复制到soapui面板里:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:zzz="http://sap.com/xi/AP/CustomerExtension/BYD/ZZZZZ">

<soapenv:Header/>

<soapenv:Body>

<glob:OpportunityByElementsQuery_sync_V1>

<!--Optional:-->

<OpportunitySelectionByElements>

<!--Zero or more repetitions:-->

<SelectionByIdentifier>

<!--Optional:-->

<InclusionExclusionCode>I</InclusionExclusionCode>

<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>

<!--Optional:-->

<LowerBoundaryIdentifier>15360</LowerBoundaryIdentifier>

</SelectionByIdentifier>

</OpportunitySelectionByElements>

</glob:OpportunityByElementsQuery_sync_V1>

</soapenv:Body>

</soapenv:Envelope>

复制结束之后是这样的:这段字符串是我给soapui发起的web service的请求负载:

Execute this request, I meet with error message: 401 Unauthorized.

执行soapui请求,遇到了401 错误,原来我忘记维护用户名和密码了。

Then I manually maintained my business user and password in request property view:

此处维护消费这个web service的用户名和密码:

You might also need to maintain proxy setting for SoapUI according to your network landscape.

如果在企业内网的防火墙里使用soapui,还需要在此处设置代理服务器:

Once you have finished all such settings, execute request again and now you can see response as expected:

一切就绪之后,使用soapui能看到web service执行的响应内容了:

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

热门产品

php编程基础教程.pptx|php编程培训,php,编程,基础,教程,pptx
php编程基础教程.pptx

历史上的今天:04月20日

ThinkPHP5快速入门

ThinkPHP5快速入门目 录零、序言一、基础二、URL和路由三、请求和响应四、数据库五、查询语言六、模型和关联 (1)模型定义 (2)基础操作 (3)读取器和修改器 (4)类型转换和自动完成 (5)查询范围 (6)输入和验证 (7)关联 (8)模型输出七、视图和模板八、调试和日志九、API开发十、命令行工具十一、扩展十二、杂项SessionCookie验证

ThinkPHP5快速入门基础

ThinkPHP5快速入门基础一、基础快速入门 ( 一 ) :基础本章介绍了 ThinkPHP5 .0 的安装及基本使用 ,并给出了一个最简单的示例带你了解如何开始开发 ,主要包 含 :简介官网下载 omposer安装和更新CGit下载和更新目录结构运行环境入口文件调试模式控制器视图读取数据总结在学习 ThinkPHP5.0 之前 ,如果你还不理解面向对象和命名空间的概念 ,建议首先去PHP手册恶

热门专题

APP开发|app开发_app开发公司_app软件开发_专业app开发_云南app开发公司_app定制_原生app开发定制
APP开发
综合高中|云南综合高中,昆明综合高中,综合高中能考本一吗,综合高中和普通高中的区别,综合高中是什么意思,综合高中能参加全国统一高考吗,综合高中可以考哪些大学,综合高中的学籍是什么
综合高中
金诺幼儿园(春城路金诺幼儿园)|昆明官渡区幼儿园,幼儿园报名,官渡区幼儿园,春城路幼儿园,幼儿园招生,学前班,昆明幼儿园,金诺幼儿园,环城南路幼儿园,石井路幼儿园
金诺幼儿园(春城路金诺幼儿园)
安徽中源管业有限公司|安徽中源管业有限公司,安徽中源管业有限公司介绍,安徽中源管业有限公司电话,安徽中源管业有限公司地址,安徽中源管业有限公司厂家,安徽中源管业有限公司电力管,安徽中源管业有限公司管材
安徽中源管业有限公司
小程序开发|微信小程序,小程序开发,小程序,小程序制作,微信小程序开发,小程序公司,小程序开发公司,分销,三级分销系统,分销系统
小程序开发
昆明综合高中|昆明综合高中
昆明综合高中
弥勒综合高中|弥勒综合高中
弥勒综合高中
云南网站建设|云南网站制作,网站建设,云南网站开发,云南网站设计,云南网页设计,云南网站建设公司,云南网站建设
云南网站建设

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部