Forum Discussion

Thibault_B's avatar
Thibault_B
New Contributor
16 years ago

Changing namespace cause Assertion XPatch Match FAILED

Hi everybody (sorry for my poor english),

I'm posting there because I face a problem I'm not able to solve.

I'm a member of the developper's team working on a big project which includes some WebServices. Here's a part of my configuration file (sping-ws based for them who may know):


<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_11" />
</property>
</bean>


<bean id="messageReceiver"
class="org.springframework.ws.soap.server.SoapMessageDispatcher">
<property name="endpointMappings">
<bean id="avecValidation" class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
<property name="interceptors">
<list>
<bean id="MessageContextHolder" class="fr.bdf.modec.surfi.MessageContext.MessageContextHolderInterceptor"/>
<bean id="RequestLogger" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
<description>
This interceptor logs the message payload.
</description>
<property name="logRequest" value="true" />
<property name="logResponse" value="false" />
</bean>
<bean id="ResponseLogger" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
<description>
This interceptor logs the message payload.
</description>
<property name="logRequest" value="false" />
<property name="logResponse" value="true" />
</bean>
</list>
</property>
</bean>
</property>
</bean>

<oxm:jaxb2-marshaller id="marshaller">

<oxm:class-to-be-bound
name="XXX" />
...
</oxm:jaxb2-marshaller>

<bean id="genericMarshaller" class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
<constructor-arg ref="marshaller" />
</bean>

<bean id="webService"
class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
<constructor-arg value="/WEB-INF/services/WebService.wsdl" />
</bean>

<bean id="schema1" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/WEB-INF/services/communs/Schema1.xsd"></property>
</bean>

<bean id="schema2" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/WEB-INF/services/communs/Schema2.xsd"></property>
</bean>

....




The testing team uses SoapUI to test our WebServices, they uses Assertions such as "Schema Compliance" or "XPath Match" which must define namespace and namespaces prefix like :
- XPath Expression: declare namespace  ns2='http://www.banque.fr/webService';
//ns2:GetGenericParamsResponse/ns2:GeneralOutput
- Expected Result: 0

The problem is after we did some minor modifications in the xsd, the testing teams did an update definition to have the modifications and the namespaces prefix all changed! ns2 become ns5, ns3 ns6 etc... so all the XPath Match are now FAILED (which is not really good)

So, we tried to find a way to set namespaces prefix as they were before but found nothing. Is it possible in some way?

In our local envirronement we did the same thing but namespaces prefix stayed the same... We're using Tomcat v6.0 and they're using was 27 I think.

Thanks in advance for any help

Have a nice day