我有一个包含我的soap请求的目录,我想重用它们来构建测试套件。 我试过使用ENTITY定义,但无法使其工作,而使用xi:include
作为我想包含的代码片段,看起来soapUI并不认识它。在soapUI项目中包含保存在文件中的请求
我的实际项目具有以下结构:
<con:soapui-project>
<con:interface >
<con:endpoints>
<con:endpoint>http://localhost/GestionePreventiviRemoteImpl/GestionePreventiviService_v1</con:endpoint>
</con:endpoints>
<con:operation isOneWay="false" action="" name="aggiornaPreventivo" bindingOperationName="aggiornaPreventivo" >
<con:settings/>
</con:operation>
<con:operation isOneWay="false" action="" name="creaPreventivo" bindingOperationName="creaPreventivo" >
<con:settings/>
</con:operation>
<con:operation isOneWay="false" action="" name="recuperaPreventivo" bindingOperationName="recuperaPreventivo">
<con:settings/>
</con:operation>
</con:interface>
<con:testSuite name="GestioneServicePortBinding TestSuite">
<con:testCase name="aggiornaPreventivo TestCase">
<con:testStep name="aggiornaPreventivo">
<con:config>
<con:interface>GestioneServicePortBinding</con:interface>
<con:operation>aggiornaPreventivo</con:operation>
<con:request name="aggiornaPreventivo">
<con:endpoint>http://localhost/GestionePreventiviRemoteImpl/GestionePreventiviService_v1</con:endpoint>
<con:request>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://simulatore.Prodotto.be.service.bmed.it/v1">
<soapenv:Header/>
<soapenv:Body>
<v1:aggiornaPreventivo>
<input>
<aggiornaPreventivoDTO>
<codPrev>1001</codPrev>
<codCliente>205</codCliente>
.....
</aggiornaPreventivoDTO>
</input>
</v1:aggiornaPreventivo>
</soapenv:Body>
</soapenv:Envelope>
]]>
</con:request>
</con:request>
</con:config>
</con:testStep>
</con:testCase>
</con:testSuite>
</con:soapui-project>
而我需要的是包括为了处理测试套件外部输入参数的测试案例的要求。因此,像:
<con:testStep name="aggiornaPreventivo">
<con:config>
<con:interface>GestioneServicePortBinding</con:interface>
<con:operation>aggiornaPreventivo</con:operation>
<con:request name="aggiornaPreventivo">
<con:endpoint>http://localhost/GestionePreventiviRemoteImpl/GestionePreventiviService_v1</con:endpoint>
<con:request>
<xi:include href="aggiornaPreventivoRequest.xml" parse="xml" xpointer="title"/>
</con:request>
</con:request>
</con:config>
</con:testStep>
凡aggiornaPreventivoRequest.xml有内容,如:
<v1:aggiornaPreventivo>
<input>
<aggiornaPreventivoDTO>
<codPrev>1001</codPrev>
<codCliente>205</codCliente>
.....
</aggiornaPreventivoDTO>
</input>
</v1:aggiornaPreventivo>
感谢您的帮助!