Hi Ole,
within the forum I found an advice of some other user to use xmlslurper class instead of GroovyUtils.
So I changed the original dispatch groovy code:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )
def username = holder.getNodeValue( "//username" )
def password = holder.getNodeValue( "//password" )
to this
def requ = new XmlSlurper().parseText(mockRequest.requestContent)
def username = requ.Body.loginRequest.username.text()
def password = requ.Body.loginRequest.password.text()
def sum = username + password
Now all the common responses are dispatched/returned correctly .
But in case of a fault (e.g. using a wrong sessionid or login with wrong password), nothing is returned.
The following three error messages are logged.
1. (this is always logged, even if the correct response was returned)
13:21:06,486 ERROR [XmlUtils] Error creating XmlOptions; org.apache.xerces.util.SecurityManager cannot be cast to com.sun.org.apache.xerces.internal.util.SecuriyManager
java.lang.ClassCastException: org.apache.xerces.util.SecurityManager cannot be cast to com.sun.org.apache.xerces.internal.util.SecurityManager
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setProperty(XMLEntityManager.java:1714)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.setProperty(XML11Configuration.java:915)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setProperty(AbstractSAXParser.java:1941)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:473)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:263)
at weblogic.xml.jaxp.WebLogicSAXParser.setProperty(WebLogicSAXParser.java:117)
at weblogic.xml.jaxp.RegistrySAXParser.setProperty(RegistrySAXParser.java:120)
at com.eviware.soapui.support.xml.XmlUtils.createDefaultXmlOptions(XmlUtils.java:311)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.getRequestXmlObject(WsdlMockRequest.java:303)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.initPostRequest(WsdlMockRequest.java:155)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.<init>(WsdlMockRequest.java:107)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:368)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.dispatchRequest(MockAsWarServlet.java:245)
at com.eviware.soapui.mockaswar.MockAsWarServlet.service(MockAsWarServlet.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
2. This is only returned, when a Fault-Response should be returned by the Mock
13:21:06,502 ERROR [SoapUI] An error occured [ Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace env='http://schemas.xmlsoap.org/soap/envelope/';//env:Fault], see error log for details
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Tryingdelegated path engine... FAILED on declare namespace env='http://schemas.xmlsoap.org/soap/envelope/';//env:Fault
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:173)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:130)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:476)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:460)
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.isSoapFault(SoapUtils.java:57)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.writeResponse(WsdlMockResponse.java:664)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.execute(WsdlMockResponse.java:311)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation.dispatchRequest(WsdlMockOperation.java:259)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:290)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:375)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.dispatchRequest(MockAsWarServlet.java:245)
at com.eviware.soapui.mockaswar.MockAsWarServlet.service(MockAsWarServlet.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
3. This one is also logged, when a Fault-Response should be returned (which doesn't work)
08.08.2012 13:21:06 com.eviware.soapui.mockaswar.MockAsWarServlet service
SCHWERWIEGEND: null
com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.RuntimeException:
Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace env='http://schemas.xmlsoap.org/soap/envelope/';//env:Fault
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.execute(WsdlMockResponse.java:323)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation.dispatchRequest(WsdlMockOperation.java:259)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:290)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:375)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.dispatchRequest(MockAsWarServlet.java:245)
at com.eviware.soapui.mockaswar.MockAsWarServlet.service(MockAsWarServlet.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace env='http://schemas.xmlsoap.org/soap/envelope/';//env:Fault
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:173)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:130)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:476)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:460)
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.isSoapFault(SoapUtils.java:57)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.writeResponse(WsdlMockResponse.java:664)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.execute(WsdlMockResponse.java:311)
... 19 more
Do you still think this is only a WLS configuration problem?
I'm not sure. I seems strange that the xmlslurper works fine as the GroovyUtils class fails on a WLS.
What could be the reason for the Mock not dispatching/returning the Fault-responses?
Best regards
Nico