最详细的使用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月28日

referrer策略和meta标签的问题

referrer策略和meta标签的问题请求后端接口时,banner图片的请求出现403错误:GEThttp://xxxxxxxxxxxx403(Forbidden)。在网上搜寻一番,解决方法如下:在index.html中的head中添加&lt;meta name=&quot;referrer&quot; content=&quot;no-referrer&quot; /&gt;。在此之前,关于r

热门专题

安徽开放大学|安徽开放大学报名,安徽开放大学报考,安徽开放大学,什么是安徽开放大学,安徽开放大学学历,安徽开放大学学费,安徽开放大学报名条件,安徽开放大学报名时间,安徽开放大学学历,安徽开放大学专业
安徽开放大学
天麻的功效与作用吃法|天麻的功效与作用,天麻的功效与作用吃法,天麻炖什么治头痛最好,天麻的功效与作用禁忌,天麻多少钱一斤,天麻的功效与作用吃法及禁忌,天麻怎么吃效果最好,天麻粉的功效与作用,天麻怎么吃
天麻的功效与作用吃法
外贸网站建设|外贸网站建设,英文网站制作,英文网站设计,美国主机空间,外贸建站平台,多语言网站制作
外贸网站建设
一年制中专|中专学历,中专是什么学历,中专是什么,中专有什么专业,中专升大专,一年制中专
一年制中专
APP开发|app开发_app开发公司_app软件开发_专业app开发_云南app开发公司_app定制_原生app开发定制
APP开发
易捷尔单招|易捷尔单招,易捷尔单招培训,易捷尔单招报名,易捷尔单招考试,易捷尔单招培训学校,易捷尔单招分数
易捷尔单招
云南巨榕教育投资集团有限公司|云南巨榕教育投资集团有限公司,巨榕教育集团,巨榕教育
云南巨榕教育投资集团有限公司
安徽中源管业|安徽中源管业,安徽中源管业mpp电力管,安徽中源管业cpvc电力管,安徽中源管业pe穿线管,安徽中源管业电力管,安徽中源管业排水管,安徽中源管业通信管,安徽中源管业管材
安徽中源管业

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部