首页 > 编程语言 >ASP.NET Web应用程序创建的webservice接口如何在postman里测试调用

ASP.NET Web应用程序创建的webservice接口如何在postman里测试调用

时间:2024-05-22 12:18:41浏览次数:16  
标签:xml Web ASP HTTP webservice Content Type string 1.1

ASMX中的方法

 启动项目浏览器展示的页面如下

 点击ReceiveOrder,展示该方法的请求和响应示例

 在postman中输入以下信息

 选择raw--xml,粘贴浏览器中的SOAP1.1或者SOAP1.2中的请求示例

 点击Send按钮发生请求

 

SOAP 1.1

以下是 SOAP 1.1 请求和响应示例。所显示的占位符需替换为实际值。

POST /WebService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://server.webservice.example.com/ReceiveOrder"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ReceiveOrder xmlns="http://server.webservice.example.com">
      <xmlString>string</xmlString>
    </ReceiveOrder>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ReceiveOrderResponse xmlns="http://server.webservice.example.com">
      <ReceiveOrderResult>string</ReceiveOrderResult>
    </ReceiveOrderResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。

POST /WebService.asmx HTTP/1.1
Host: localhost
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <ReceiveOrder xmlns="http://server.webservice.example.com">
      <xmlString>string</xmlString>
    </ReceiveOrder>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <ReceiveOrderResponse xmlns="http://server.webservice.example.com">
      <ReceiveOrderResult>string</ReceiveOrderResult>
    </ReceiveOrderResponse>
  </soap12:Body>
</soap12:Envelope>

HTTP POST

以下是 HTTP POST 请求和响应示例。所显示的占位符需替换为实际值。

POST /WebService.asmx/ReceiveOrder HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: length

xmlString=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://server.webservice.example.com">string</string>

 

标签:xml,Web,ASP,HTTP,webservice,Content,Type,string,1.1
From: https://www.cnblogs.com/luna-hehe/p/18206000

相关文章

  • [SWPU2019]Web1 1
    这是一道非常典型的sql注入题目首先引入眼帘的是一个登录框我们进行sql注入的尝试该输入框排除为注入点的可能注册并登录后对广告发布功能进行测试:对关键字进行了过滤经fuzz测试发现其对空格orandinformation_schema等关键字进行了过滤我们先对回显进行判断1'/......
  • webserver接口如何在postman里调用测试
    测试环境:springboot+webservice接口入口 接口实现 cxf配置 cxf配置文件中决定了如何在浏览器查看wsdl文件例如在浏览器中输入http://127.0.0.1:8080/webService?wsdl展示该项目下所有的接口服务 在浏览器中输入http://127.0.0.1:8080/webService/ReceivePlanService......
  • Asp-Net-Core开发笔记:使用原生的接口限流功能
    前言之前介绍过使用AspNetCoreRateLimit组件来实现接口限流从.Net7开始,AspNetCore开始内置限流组件,当时我们的项目还在.Net6所以只能用第三方的现在都升级到.Net8了,当然是得来试试这个原生组件体验后:配置使用都比较简单,不过功能也没有AspNetCoreRateLimit那么灵活......
  • H5 缓存机制浅析 移动端 Web 加载性能优化
     H5缓存机制浅析移动端Web加载性能优化 转自:https://www.cnblogs.com/bugly/p/5039153.html1H5缓存机制介绍H5,即HTML5,是新一代的HTML标准,加入很多新的特性。离线存储(也可称为缓存机制)是其中一个非常重要的特性。H5引入的离线存储,这意味着web应用可......
  • .net webapi 处理前端请求跨域问题
    1.打开 Program.cs文件,在 varapp=builder.Build();语句前添加如下代码builder.Services.AddCors(o=>o.AddPolicy("any",p=>p.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()));2.在varapp=builder.Build();语句后添加 app.UseCors();app.UseCors();......
  • 向Web服务器端上传文件
    server.pyimportflaskapp=flask.Flask(__name__)@app.route('/',methods=['GET','POST'])defuploadFile():msg=""try:if"fileName"inflask.request.values:fileName=fl......
  • 基于webapi的websocket聊天室(番外一)
    上一篇我已经实现了聊天室,并且在协议中实现了4种类型的消息传输。其实还可以添加video,audio,live等等类型。不过假如把目前的协议看作RCP1.0版的话,这个版本就只支持有限的4种消息。精力有限啊。也许RCP2.0就可以把video,audio类型加进去?这不是这篇番外考虑的。而是我在定义和实现......
  • web服务器和FTP服务器
    web(网页)(http)服务器浏览器:http客户端HTTP协议端口号:TCP:80HTTPs协议端口号:TCP:443 WEB服务器发布软件:微软:IIS(可以发布WEB网站和FTP站点)Linux:Apache/LAMP/Tomcat/nginx.etc第三方:phpstudy/XAMPP    FTP服务器:1、FileTransforProtocol:文件传输协议2、端口号:T......
  • Web前置知识(1)
    Web知识汇总(1)1.phps文件就是php文件的源代码文件,通常用于提供给用户查看php代码,因为用户无法直接通过Web浏览器看到php文件的内容,所以需要用phps文件代替。2.burpsuite可以进行url的编解码3.浏览器本身会进行一次url解码4.反序列化漏洞序列化是广泛存在于PHP、Java等编程语言......
  • weblogic漏洞浅谈
    weblogic反序列化漏洞原理分析weblogic是oracle公司出品的applicationserver,用于本地和云端开发,集成,部署和大型分布式web应用,网络应用和数据库应用的Java应用服务器weblogicserver是一个基于JAVAEE架构的中间件,将java的动态功能和javaEnterprise标准的安全性引入大型网络应用......