Soapui maven插件无法解析XmlHolder

时间:2016-07-14 13:41:03

标签: eclipse scala maven soap soapui

我在SoapUI中创建了一个Soap Service模拟来运行一些集成测试。我还放了一个groovy脚本来验证其中的一些字段。

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

当我运行通过Eclipse JUnit插件调用mock的测试时,手动启动SoapUI Mock一切顺利,但是当我使用mvn test运行测试时 - 使用soapui-maven-plugin - 我得到一个例外:< / p>

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]"]

[EDITED] 更多信息: 我的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

你可以帮帮我吗?

由于

1 个答案:

答案 0 :(得分: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>