Announcement Announcement Module
Collapse
No announcement yet.
spring web service thread safety issue ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring web service thread safety issue ?

    I'm using spring web services 1.5.9 (with AxiomSoapMessagefactory and xmlbeans 2.4.0) configured as shown in the second code snippet (ws-servlet.xml).

    When working with a single thread the web service works perfectly. However when load testing the service (using soapui) I seem to get random soap faults like shown in the first code snippet.

    The strange thing is that when I look at the xml message in my web service logfile it seems ok. I can also take that xml message, paste into a soapui test request, and execute the request successfully.

    I have the impression this could be a threading issue in one of the libraries. Could that be, is it something wrong in my configuration, is it a spring ws bug ?

    Please advice.

    Thanks, EDH

    SOAP Fault snippet

    Code:
    2011-04-15 06:32:29,445 [httpSSLWorkerThread-80-6] - dc21ccdd-da71-4768-9105-c52d30ebfef3 - [ERROR] regbws.audit - <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring xml:lang="nl">XML validatie fout</faultstring><detail><spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-complex-type.2.4.b: The content of element 'AlternatieveInstanties' is not complete. One of '{AlternatieveInstantie}' is expected.</spring-ws:ValidationError></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    Configuration snippet

    Code:
    <!--  
    <import resource="classpath*:/spring-bwsreg-main.xml" />
    -->
    <import resource="classpath*:/spring-bwsreg-propertyloading.xml" />
    
    <bean id="regBwsPRQNEM" 
        class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
        <property name="interceptors">
            <list>
                <ref bean="regBwsSoapMessagesLoggingInterceptor" />
                <ref bean="regBwsWss4jSecurityInterceptor" />
                <!--
                    Two validating interceptors are needed if both requests and
                    responses are to be validated. If only one is used to validate
                    both, it doesn't work and you get an error that the response xsd
                    can't be found
                -->
                <ref bean="regBwsRequestValidatingInterceptor" />
                <ref bean="regBwsResponseValidatingInterceptor" />
            </list>
        </property>
    
        <property name="mappings">
            <props>
                <prop
                    key="{http://registreerbewijs.bewijsregistratiedienst.led.xyz.be}RegistreerBewijs">registreerBewijsEndpoint</prop>
            </props>
        </property>
    </bean>
    
    
    <bean id="regBwsSoapMessagesLoggingInterceptor"
        class="be.xyz.ov.led.ws.interceptor.impl.SOAPEndpointLoggingInterceptorImpl">
        <property name="endpointAuditLoggerName" value="regbws.audit" />
        <property name="endpointErrorLoggerName" value="regbws.error" />
    </bean>
    
    
    <bean id="regBwsRequestValidatingInterceptor"
        class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
        <property name="validateRequest" value="true" />
        <property name="validateResponse" value="false" />
        <property name="addValidationErrorDetail" value="true" />
        <property name="faultStringOrReason" value="XML validatie fout" />
        <property name="faultStringOrReasonLocale" value="nl" />
        <property name="schemas">
            <list>
                <value>classpath*:/schemaorg_apache_xmlbeans/src/BewijsregistratieDienst/RegistreerBewijs/RegistreerBewijs.xsd
                </value>
            </list>
        </property>
    </bean>
    <bean id="regBwsResponseValidatingInterceptor"
        class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
        <property name="validateRequest" value="false" />
        <property name="validateResponse" value="true" />
        <property name="addValidationErrorDetail" value="true" />
        <property name="faultStringOrReason" value="XML validatie fout" />
        <property name="faultStringOrReasonLocale" value="nl" />
        <property name="schemas">
            <list>
                <value>classpath*:/schemaorg_apache_xmlbeans/src/BewijsregistratieDienst/RegistreerBewijs/RegistreerBewijsResponse.xsd
                </value>
            </list>
        </property>
    </bean>
    
    <bean id="regBwsWss4jSecurityInterceptor"
        class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
        <property name="validationActions" value="UsernameToken" />
        <property name="validationCallbackHandler" ref="regBwsCallbackHandler" />
    </bean>
    <bean id="regBwsCallbackHandler"
        class="org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler">
        <property name="users">
            <props>
                <prop key="${bwsreg.regbws.magda.uname}">${bwsreg.regbws.magda.pwd}</prop>
            </props>
        </property>
    </bean>
    
    
    <bean id="messageFactory"
        class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
        <property name="payloadCaching" value="true" />
    </bean>
    <bean id="xmlBeansMarshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" />
    
    <!-- Endpoints -->
    <bean id="registreerBewijsEndpoint"
        class="be.xyz.ov.led.bwsregdnst.registreerbewijs.ws.endpoint.impl.WebServiceImpl">
        <property name="marshaller" ref="xmlBeansMarshaller" />
        <property name="unmarshaller" ref="xmlBeansMarshaller" />
        <property name="registreerBewijsAction" ref="registreerBewijsAction" />
    </bean>
    
    <bean id="exceptionResolver" class="org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver">
        <property name="locale" value="nl"/>
    </bean>
Working...
X