广告
返回顶部
首页 > 资讯 > 数据库 >WSDL测试webservice接口记录
  • 593
分享到

WSDL测试webservice接口记录

WSDL测试webservice接口记录 2019-11-02 22:11:19 593人浏览 才女
摘要

WSDL测试webservice接口记录

WSDL测试WEBservice接口记录

osc_sdo8al3q 2018/09/12 17:51 阅读数 104

收到一个事情,需要对接第三方api,对方给了个service,看了一下,原来是webservices的。

上一次测试webervice的接口,还是至少八九年前的时候了,这种相对比较老旧的也好久不在使用。

于是,简单搞了一下,从搭环境到测试完成,基本花了10来分钟,对比结果花点时间,也抽空简单记录一下。 

请求:

Http://www.shuce.com.cn/services/CommService?wsdl

接口:call

参数:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.shuce.com.cn">
<soapenv:Header/>
<soapenv:Body>
<ser:call>
<ser:act>dscx_lzser:act>

<ser:args>74481885-4244-47d9-aa51-88e2aabebdbcser:args>
<ser:args>cxvehser:args>
<ser:args>C372DDser:args>
<ser:args>02ser:args>
ser:call>    
soapenv:Body>
soapenv:Envelope>

 

返回:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<callResponse xmlns="http://service.shuce.com.cn">
<callReturn>{"ret":1,"clpp":"宝马牌","clxh":"BMW7202ES(BMWX1)","GCjk":"国产","zzg":"中国","zzcmc":"华晨宝马汽车有限公司","fdjxh":"N46B20E","hdzk":"5","ckg":"4477*1798*1577","csys":"棕","rlzl":"汽油","pl":"1995","gl":"122","cllx":"小型轿车","syxz":"非营运","ccdjrq":"20130917","zt":"正常","hbdbqk":"GB18352.3-2005(国Ⅳ阶段)","ccrq":"20130522","yxqz":"20190930","qzbfqz":"20991231"}
</callReturn>
callResponse>
</soapenv:Body>
soapenv:Envelope>

 

JSON格式化结果:

{
"ret": 1,
"clpp": "宝马牌",
"clxh": "BMW7202ES(BMWX1)",
"gcjk": "国产",
"zzg": "中国",
"zzcmc": "华晨宝马汽车有限公司",
"fdjxh": "N46B20E",
"hdzk": "5",
"ckg": "4477*1798*1577",
"csys": "棕",
"rlzl": "汽油",
"pl": "1995",
"gl": "122",
"cllx": "小型轿车",
"syxz": "非营运",
"ccdjrq": "20130917",
"zt": "正常",
"hbdbqk": "GB18352.3-2005(国Ⅳ阶段)",
"ccrq": "20130522",
"yxqz": "20190930",
"qzbfqz": "20991231"
}

 

其他

后来,我看了一下别的wsdl:

http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl

做了一个测试,结果测试OK,简要也记录一下

request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://WebXml.com.cn/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:getCountryCityByIp>
         
         <web:theIpAddress>115.239.210.27web:theIpAddress>
      web:getCountryCityByIp>
   soapenv:Body>
soapenv:Envelope>

response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <getCountryCityByIpResponse xmlns="http://WebXml.com.cn/">
         <getCountryCityByIpResult>
            <string>115.239.210.27string>
            <string>浙江省绍兴市 电信string>
         getCountryCityByIpResult>
      getCountryCityByIpResponse>
   soap:Body>
soap:Envelope>

...

如果你想要尝试一下,进行一些测试,这里提供了一些wsdl,可以用来测试,可以试试。

 

所谓授之以鱼,不如授之以渔。这里也补上一些前提和方法:

下载地址:

官网:https://www.soapui.org/professional/soapui-pro.html

文件地址:http://cncspace.onlinedown.net/down/SoapUI-5.2.1-Mac-bin.zip

下载地址:http://www.onlinedown.net/soft/177299.htm

下载之后的安装很简单,略过,简要提一下启动。如果用的是mac的话,这样启动:

启动命令:

cd /Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin
./soapui.sh

haodeMBP:bin hao$ pwd

/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin

haodeMBP:bin hao$ ls

SoapUI-Spashscreen.png installationcomplete.sh mockservicerunner.sh soapui-errors.log soapui.sh toolrunner.sh wargenerator.sh

actions listeners securitytestrunner.sh soapui-log4j.xml starter-page.html uninstallactiontrack.sh

ext loadtestrunner.sh soapui-5.2.1.jar soapui.log testrunner.sh updateinstallation.sh

haodeMBP:bin hao$ ./soapui.sh 

================================

=

= SOAPUI_HOME = /Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1

=

================================

Configuring log4j from [/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-log4j.xml]

16:26:15,406 INFO  [DefaultSoapUICore] Creating new settings at [/Users/hao/soapui-settings.xml]

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

16:26:16,523 INFO  [PluginManager] 0 plugins loaded in 3 ms

16:26:16,523 INFO  [DefaultSoapUICore] All plugins loaded

Configuring log4j from [/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-log4j.xml]

16:26:16,729 INFO  [DefaultSoapUICore] Creating new settings at [/Users/hao/soapui-settings.xml]

16:26:16,740 INFO  [PluginManager] 0 plugins loaded in 0 ms

16:26:16,740 INFO  [DefaultSoapUICore] All plugins loaded

16:26:23,688 INFO  [DefaultSoapUICore] Defaulting to native L&F for Mac OS X

16:26:23,740 INFO  [SoapUI] Used java version: 1.8.0_181

16:28:17,764 INFO  [SchemaUtils] Added default schema from file:/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-5.2.1.jar!/com/eviware/soapui/resources/xsds/xop.xsd with targetNamespace http://www.w3.org/2004/08/xop/include

16:28:17,781 INFO  [SchemaUtils] Added default schema from file:/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-5.2.1.jar!/com/eviware/soapui/resources/xsds/XMLSchema.xsd with targetNamespace http://www.w3.org/2001/XMLSchema

16:28:17,782 INFO  [SchemaUtils] Added default schema from file:/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-5.2.1.jar!/com/eviware/soapui/resources/xsds/xml.xsd with targetNamespace http://www.w3.org/XML/1998/namespace

16:28:17,782 INFO  [SchemaUtils] Added default schema from file:/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-5.2.1.jar!/com/eviware/soapui/resources/xsds/swaref.xsd with targetNamespace http://ws-i.org/profiles/basic/1.1/xsd

16:28:17,783 INFO  [SchemaUtils] Added default schema from file:/Users/hao/Downloads/SoapUI-5.2.1-mac-bin/SoapUI-5.2.1/bin/soapui-5.2.1.jar!/com/eviware/soapui/resources/xsds/xmime200505.xsd with targetNamespace http://www.w3.org/2005/05/xmlmime

可见启动之后,就打开了对应的应用程序窗口。

至于工具的使用,我向来觉得是不用看教程,任何工具拿上来随便点两下,就明白了,这个soapUI也是一样的。


 

其实方法这里已经写的很清楚了,而且没什么问题。照着操作即可。

以上是原创,下面这一段是摘录的。

测试操作步骤如下:

  (1)首先找到cxf-webservice.xml配置信息中地址,在浏览器中出入:http://127.0.0.1:8080/ssg?wsdl会生成文档说明,直接给要对接的用户即可

<jaxws:endpoint id="ssg" implementor="cn.exchange.cxf.DataExchangeWebServiceImpl"
      address="http://127.0.0.1:8080/ssg">
 jaxws:endpoint>

  (2)使用soapUI测试接口:

  注意:在测试之前,要先开启接口项目

  ①在接口项目开启之后,打开工具soapUi,新建(file→create empty project),如下图所示:

  ②右击工程project——add wsdl,如下图所示:

  打开如下图的页面:

  ③然后进入如下页面:(修改:应该双击"request1")

  双击"request1"出现如下的窗口:

 

  ④在"?"号处输入相关的参数,点击运行,如果右侧空白没有出现错误的信息,说明接口方法可以使用

  测试失败,如下所示:(对于不同的项目,可能提示信息有所不同,要视情况而定,这里不是绝对的结果)

  测试成功,如下图:(对于不同的项目,可能提示信息有所不同,要视情况而定,这里不是绝对的结果)

 

可见,WSDL的测试相对比较简单,如果没接触过的话,花几分钟看下就会明白。

如上。

 

--20180912 15:49于沪 长宁白猫科技园

 

soapui

本文转载自:https://www.cnblogs.com/haochuang/p/9636315.html

您可能感兴趣的文档:

--结束END--

本文标题: WSDL测试webservice接口记录

本文链接: https://www.lsjlt.com/news/8234.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • WSDL测试webservice接口记录
    ...
    99+
    2019-11-02
    WSDL测试webservice接口记录
  • python单个接口测试记录
    #encoding=utf-8 import chardet import urllib import requests import json import os import hashlib '''校验短信验证码到接口...
    99+
    2023-01-31
    接口 测试 python
  • java利用webService 如何实现一个WSDL接口
    java利用webService 如何实现一个WSDL接口?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。一、使用JDK生成WSDL的对象类cmd进入JDK的bin文件中  ...
    99+
    2023-05-31
    java wsdl webservice
  • python在webservice接口测
        接口测试第二波,webservice接口来咯,欢迎各位小伙伴吐槽~    本次拿免费的互联网国内手机号码归属地查询WEB服务webservice接口做例子,当然有很多免费webservice接口可以供大家使用,百度一下就有N多,手机...
    99+
    2023-01-31
    接口 python webservice
  • 使用Postman和SoapUI工具测试WebService接口
    一、使用Postman测试WebService接口 Postman:适用RESTful接口(HTTP/HTTPS协议)的功能测试 通过浏览器访问http://oa.tmt.tcl.c...
    99+
    2022-11-13
  • soapUI+groovy 接口测试之部分groovy使用记录
    1, 写入值(30,31),更新到数据表的多条记录。sqlStr ="select column_id from 1dcq_shop_column2  where shop_i...
    99+
    2022-10-18
  • 如何使用Postman和SoapUI工具测试WebService接口
    这篇文章主要讲解了“如何使用Postman和SoapUI工具测试WebService接口”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何使用Postman和SoapUI工具测试WebSer...
    99+
    2023-06-30
  • 软件测试-接口测试-代码实现接口测试
    文章目录 1.request 1.1 request介绍 1.2 发送get请求 1.3 发送set请求 1.4 其...
    99+
    2023-09-06
    php json
  • SpringBoot项目使用 axis 调用webservice接口的实践记录
    目录序WebService定义个人理解实践webservice 常识一个webservice 接口发布地址往往类似:qq在线接口验证接口为例maven 使用 axis应用依赖(不可缺...
    99+
    2022-11-13
  • SpringBoot调用第三方WebService接口的操作技巧(.wsdl与.asmx类型)
    SpringBoot调webservice接口,一般都会给你url如: http://10.189.200.170:9201/wharfWebService/services/Wha...
    99+
    2022-11-12
  • Python接口测试中通过登录接口获取实
    1、封装login_token 2、headers:对应登录请求头部信息 3、request_param:登录的参数数据 4、json.dumps:将一个Python数据结构转换为JSON 5、dict(response.json()):...
    99+
    2023-01-31
    接口 测试中 Python
  • Python接口自动化浅析登录接口测试实战
    目录1、什么是接口?那么,接口测试和功能测试的区别在哪呢?2、如何开展接口测试?3、如何设计接口用例?1.获取接口文档Fiddler2.分析接口文档的接口,提取测试点3.接口测试用例...
    99+
    2022-11-12
  • PostMan接口测试(很全面的接口测试教程)
    一:理论部分 1. 前言 在前后端分离开发时,后端工作人员完成系统接口开发后,需要与前端人员对接,测试调试接口,验证接口的正确性可用性。而这要求前端开发进度和后端进度保持基本一致,任何一方的进度跟不上,都无法及时完成功能模块的测试。 ​ 做...
    99+
    2023-09-16
    postman python 测试工具
  • Windows xp sp3 测试记录
    春节前,接到微软的Windows xp sp3和Vista sp1的测试光盘。 因为,光盘的原因,错过了一些日子,春节后,针对XP的sp3作了一下测试,很简单,没有深入。 简单记录一下。 测试版本:windows xp sp3 releas...
    99+
    2023-01-31
    测试 Windows xp
  • python接口测试(三)
    引入unittest框架get请求#coding: utf-8 import unittest import requests import json class TestGet(unittest.TestCase):     def s...
    99+
    2023-01-31
    接口 测试 python
  • python测试dubbo接口
    本文主要介绍使用Python调用Hession协议dubbo接口示例。 关于Dubbo Hession协议: Dubbo本身支持多种远程调用方式,例如Dubbo RPC(二进制序列化 + tcp协议)、http invoker(二进...
    99+
    2023-01-31
    接口 测试 python
  • python接口测试(一)
    基于Jenkins接口测试# coding = utf-8 import httplib http_client = None http_client = httplib.HTTPConnection('localhost' , 808...
    99+
    2023-01-31
    接口 测试 python
  • Python接口测试实战1(下)- 接口
    如有任何学习问题,可以添加作者微信:lockingfree 课程目录 Python接口测试实战1(上)- 接口测试理论 Python接口测试实战1(下)- 接口测试工具的使用 Python接口测试实战2 - 使用Python发送请求 ...
    99+
    2023-01-30
    接口 实战 测试
  • jmeter接口怎么测试
    这篇文章主要介绍“jmeter接口怎么测试”,在日常操作中,相信很多人在jmeter接口怎么测试问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”jmeter接口怎么测试”的疑惑有所帮助!接下来,请跟着小编一起来...
    99+
    2023-06-21
  • Android异步接口测试
      基于Android的C/S移动应用中访问后端数据的场景是非常多的,异步接口测试主要是在单元测试完成的基础上检查接口级访问是否正确,主要保证对外请求的组装与发送是否符合后...
    99+
    2022-06-06
    接口测试 接口 测试 Android
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作