我有一個包含我的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>
感謝您的幫助!