Felipe Martinez Felipe Martinez - 4 months ago 52
Scala Question

Soapui maven plugin can not parse XmlHolder

I created a Soap Service mock in SoapUI to run some integration tests. I also put a groovy script to validate some fields within.

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


When I run my test that call the mock through Eclipse JUnit plugin, and start the SoapUI Mock manually everything goes well, but when I run the test with mvn test - using soapui-maven-plugin - I got an exception:

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>




It seems to be this line that I'm getting error:

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


[EDITED]
More info:
snippet of my 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>


This is the service that I am trying to mock

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


Could you help me with that?

Thanks

Answer

Fixed removing the following dependency

                 <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>
Comments