Soapui maven插件无法解析XmlHolder
Soapui maven plugin can not parse XmlHolder
我在 SoapUI 中创建了一个 Soap 服务模拟来 运行 一些集成测试。我还放了一个 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 插件调用模拟,并手动启动 SoapUI Mock 时一切顺利,但是当我 运行 使用 mvn 测试测试时 - 使用 soapui- maven-plugin - 我有一个例外:
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
你能帮我吗?
谢谢
已修复删除以下依赖项
<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>
我在 SoapUI 中创建了一个 Soap 服务模拟来 运行 一些集成测试。我还放了一个 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 插件调用模拟,并手动启动 SoapUI Mock 时一切顺利,但是当我 运行 使用 mvn 测试测试时 - 使用 soapui- maven-plugin - 我有一个例外:
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
你能帮我吗?
谢谢
已修复删除以下依赖项
<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>