2016-07-14 105 views
0

我在SoapUI中創建了一個Soap Service模擬器來運行一些集成測試。我也放了一個groovy腳本來驗證其中的一些字段。Soapui maven插件無法解析XmlHolder

import java.math.BigDecimal; 
def holder = new com.eviware.soapui.support.XmlHolder(mockRequest.requestContent) 
def lineItemId1 = holder["//*:QuotationRequest/*:LineItem[1]/@lineItemId[1]"] 

當我運行我的測試呼叫通過Eclipse的JUnit的插件模擬,並啓動了SoapUI模擬手動一切順利,但是當我運行MVN測試的測試 - 採用的soapUI - Maven的插件 - 我例外:

10:17:55,056 ERROR [SoapUI] An error occurred java.lang.ClassCastException: 
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath cannot be cast to 
org.apache.xmlbeans.impl.store.SaxonXBeansDelegate$SelectPathInterface], see error log for details 
java.lang.RuntimeException: java.lang.ClassCastException: 
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath cannot be cast to 
org.apache.xmlbeans.impl.store.SaxonXBeansDelegate$SelectPathInterface 


2016-07-14 10:17:55,180 WARN PhaseInterceptorChain:449 - Interceptor for 
{http://www.vertexinc.com/oseries/services/CalculateTax60}CalculateTaxWSService60#{http://www.vertexinc.com/oseries/services/CalculateTax60}calculateTax60 
has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Response was of unexpected text/html ContentType. 
Incoming portion of HTML stream: 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Body> 
    <soapenv:Fault> 
     <faultcode>?</faultcode> 
     <faultstring>?</faultstring> 
    </soapenv:Fault> 
</soapenv:Body> 

這似乎是此行我收到提示:

holder["//*:QuotationRequest/*:LineItem[1]/@lineItemId[1]"] 

將帖子 更多信息: 片斷我的pom.xml

<plugin> 
      <groupId>com.smartbear.soapui</groupId> 
      <artifactId>soapui-maven-plugin</artifactId> 
      <version>5.1.3</version> 
      <executions> 
       <execution> 
        <id>Vertex</id> 
        <phase>test-compile</phase> 
        <goals> 
         <goal>mock</goal> 
        </goals> 
        <configuration> 
         <projectFile>${pom.basedir}/../core/Vertex-soapui-project.xml</projectFile> 
         <noBlock>true</noBlock> 
         <port>8284</port> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

的這是我試圖嘲弄

http://vha0230.vertexinc.com/vertex-ws/services/CalculateTax60?WSDL

你能幫助我的服務?

感謝

+0

聽起來像是依賴版本的問題。我不明白:「當我通過Eclipse JUnit插件運行時,但是當我運行使用soapui-maven-plugin時」 - 這是兩個完全不同的框架。你應該添加信息如何運行你的東西在一個,然後另一個。我們需要重現的步驟,否則它不會發生! – SiKing

+0

@SiKing感謝您的反饋。編輯的問題。你認爲這裏需要更多信息嗎? –

+0

錯誤日誌是否有更多信息。發佈您的pom的相關部分。我仍然只是在猜測事情,因爲我還沒有看到重現的步驟。 – SiKing

回答

0

修正刪除以下依存

    <groupId>com.smartbear.soapui</groupId> 
       <artifactId>soapui-maven-plugin</artifactId> 
       <version>5.1.3</version> 
       <dependencies> 
        <dependency> 
         <groupId>org.reflections</groupId> 
         <artifactId>reflections</artifactId> 
         <version>0.9.9-RC1</version> 
        </dependency> 
        <dependency> 
         <groupId>org.apache.poi</groupId> 
         <artifactId>poi-ooxml</artifactId> 
         <version>3.10-FINAL</version> 
        </dependency> 
       </dependencies>