首页 \ 问答 \ REST服务测试 - SOAP UI(REST Service testing - SOAP UI)

REST服务测试 - SOAP UI(REST Service testing - SOAP UI)

我需要添加JSON格式参数来请求有效负载在restful服务测试中执行POST请求。 我如何在SOAP UI中执行此操作?


I need to add JSON format parameters to request payload to do a POST request in restful service testing. How can I do that in SOAP UI?


原文:https://stackoverflow.com/questions/28071714
更新时间:2022-04-10 21:04

最满意答案

有关将字符串转换为表格的部分,请查看这是否适用。

Declare @StrList Varchar(1000) = 'PX03 - PX069, PX20, PX202, PX25 - PX270, PX250 - PX2509, PX251, PX2511 - PX2513'
Declare @RangeTable Table (RangeFrom VarChar(32), RangeTo VarChar(32))
Select @StrList = Replace(@StrList,' ', '') + ','
Declare @StrListItem Varchar(32)
While CHARINDEX(',', @StrList) > 0
Begin
    Select @StrListItem = SUBSTRING(@StrList,1,CHARINDEX(',', @StrList) - 1)
    Declare
      @RangeFrom VarChar(32)
    , @RangeTo  VarChar(32)
    If CHARINDEX('-', @StrListItem) = 0
    Begin
        Select 
          @RangeFrom = @StrListItem
        , @RangeTo = @StrListItem
    End
    Else
    Begin
        Select 
          @RangeFrom = SUBSTRING(@StrListItem, 1, CHARINDEX('-', @StrListItem) - 1)
        , @RangeTo = SUBSTRING(@StrListItem, CHARINDEX('-', @StrListItem) + 1, LEN(@StrListItem) - CHARINDEX('-', @StrListItem))
    End
    Insert Into @RangeTable (RangeFrom, RangeTo) Values (@RangeFrom, @RangeTo)
    Select @StrList = SUBSTRING(@StrList, CHARINDEX(',', @StrList) + 1, LEN(@StrList) - CHARINDEX(',', @StrList))
End
Select * From @RangeTable

See if this works for you for the part about converting the string to a table.

Declare @StrList Varchar(1000) = 'PX03 - PX069, PX20, PX202, PX25 - PX270, PX250 - PX2509, PX251, PX2511 - PX2513'
Declare @RangeTable Table (RangeFrom VarChar(32), RangeTo VarChar(32))
Select @StrList = Replace(@StrList,' ', '') + ','
Declare @StrListItem Varchar(32)
While CHARINDEX(',', @StrList) > 0
Begin
    Select @StrListItem = SUBSTRING(@StrList,1,CHARINDEX(',', @StrList) - 1)
    Declare
      @RangeFrom VarChar(32)
    , @RangeTo  VarChar(32)
    If CHARINDEX('-', @StrListItem) = 0
    Begin
        Select 
          @RangeFrom = @StrListItem
        , @RangeTo = @StrListItem
    End
    Else
    Begin
        Select 
          @RangeFrom = SUBSTRING(@StrListItem, 1, CHARINDEX('-', @StrListItem) - 1)
        , @RangeTo = SUBSTRING(@StrListItem, CHARINDEX('-', @StrListItem) + 1, LEN(@StrListItem) - CHARINDEX('-', @StrListItem))
    End
    Insert Into @RangeTable (RangeFrom, RangeTo) Values (@RangeFrom, @RangeTo)
    Select @StrList = SUBSTRING(@StrList, CHARINDEX(',', @StrList) + 1, LEN(@StrList) - CHARINDEX(',', @StrList))
End
Select * From @RangeTable

相关问答

更多
  • Python为您提供了大量的选项来处理这种情况。 如果您有示例代码,我们可以为您缩小范围。 您可以查看的一个选项是all运算符: >>> all([1,2,3,4]) True >>> all([1,2,3,False]) False 您也可以检查过滤列表的长度: >>> input = [1,2,3,4] >>> tested = [i for i in input if i > 2] >>> len(tested) == len(input) False 如果您正在使用for构造,则可以在遇到负面测 ...
  • 这是一个非递归方法来输出数组元素的所有组合。 这肯定比递归解决方案更复杂。 它的工作原理是在列表中的每个数组中最近输出数字的补充数组中保存记录。 import java.util.Arrays; import java.util.LinkedList; import java.util.List; public class Iter { public static void main(String[] args) { List list = new LinkedLi ...
  • 这是一个古典问题,如果你颠倒逻辑,实际上更容易。 让我举一个例子。 我会在这里发布一段时间,其他时期的所有不同变化都以某种方式重叠。 |-------------------| compare to this one |---------| contained within |----------| contained within, equal st ...
  • 有关将字符串转换为表格的部分,请查看这是否适用。 Declare @StrList Varchar(1000) = 'PX03 - PX069, PX20, PX202, PX25 - PX270, PX250 - PX2509, PX251, PX2511 - PX2513' Declare @RangeTable Table (RangeFrom VarChar(32), RangeTo VarChar(32)) Select @StrList = Replace(@StrList,' ', '') + ...
  • for(List valueList : map.values()) { for(String value : valueList) { ... } } 这确实是“正常”的方式。 或者,如果你还需要钥匙...... for(Map.Entry> entry : map.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue() ...
  • 你没有充分利用C ++ 11的类型推导。 另外,当迭代整数时,通过引用访问它们是毫无意义的。 你的代码没有编译的原因有两方面:1.你不能用引用默认构造一个元组,2.当你有一个const引用时你不能改变它的值。 boost::tuple x; 反正是不必要的。 #include #include #include void foo(std::vector& a, std: ...
  • SELECT * from MyTable where(Column1 between 1 and 5)or(Column1 10 and 15)or Column2 in(1,2,3) I guess sample data and desired results would have been good information. I ended up finding my own answer through trial and error. Thank you for looking. I neede ...
  • 这应该做到这一点。 a = [(800..1200), (800..1600), (800..1700), (800..1900), (900..1500), (1000..2000), (2200..2300)] a.each_with_object([]) { |r,a| a << r.first << r.last } .uniq .sort .each_cons(2) .to_a .map { |a,b| a..b } #=> [800..900, 900..1000, ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。