2014-07-21 7 views
0

현재 매우 큰 응답을 보내는 SOAP 웹 서비스를 호출합니다.AxiomSoapMessageFactory를 사용하여 클라이언트 측에서 웹 서비스 응답 읽기 향상

웹 서비스를 호출하는 동안 Spring-WS (WebServiceTemplate 사용), JAX-WS 클라이언트를 사용하며 애플리케이션은 Jboss EAP 6.0에서 실행됩니다.

현재 SaajSoapMessageFactory도 사용합니다. 읽기 성능을 높이기 위해 AxiomSoapMessageFactory를 SaajSoapMessageFactory (http://docs.spring.io/spring-ws/site/reference/html/common.html) 대신 사용해야한다는 내용의 포럼을 읽었습니다. 예상대로이 변경 괜찮 았는데

<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"> 
     <property name="payloadCaching" value="true"/> 
    </bean> 

에 의해

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

을 대체 :

나는 다음과 같은 수정을했다. 그러나, 나는 위에서 언급 한 링크를 어떻게 설정 제안 다음

<property name="payloadCaching" value="false"/> 

I이 옵션을 설정하고 웹 서비스를 호출 할 때, 나는 아래의 예외 얻을 후 :

org.springframework.ws.soap.axiom.AxiomSoapBodyException: Could not access envelope: null; nested exception is org.apache.axiom.om.NodeUnavailableException: org.springframework.ws.soap.axiom.AxiomSoapBodyException: Could not access envelope: null; nested exception is org.apache.axiom.om.NodeUnavailableException 
    at org.springframework.ws.soap.axiom.AxiomSoapEnvelope.getBody(AxiomSoapEnvelope.java:97) [:2.2.0.RELEASE] 
    at org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:38) [:2.2.0.RELEASE] 
    at org.springframework.ws.soap.AbstractSoapMessage.getPayloadSource(AbstractSoapMessage.java:50) [:2.2.0.RELEASE] 
    at org.springframework.ws.support.MarshallingUtils.unmarshal(MarshallingUtils.java:55) [:2.2.0.RELEASE] 
    at org.springframework.ws.client.core.WebServiceTemplate$3.extractData(WebServiceTemplate.java:413) [:2.2.0.RELEASE] 
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:616) [:2.2.0.RELEASE] 
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555) [:2.2.0.RELEASE] 
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390) [:2.2.0.RELEASE] 
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383) [:2.2.0.RELEASE] 
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:373) [:2.2.0.RELEASE] 

하나를 왜이 오류에 대한 아이디어? 다른 옵션을 변경하지 못했거나 사용했던 라이브러리 파일의 비 호환성 때문입니까?

또 다른 질문 :


og4j.logger.org.springframework.ws.client.MessageTracing에 관한 내 log4j에 항목을 주석 후, 나는 성공적으로 웹 서비스를 comsume 할 수 있었다. 또한 성능 테스트를 실시한 결과, 50 명의 사용자가 동시에 웹 서비스에 액세스하는 간접적 인 테스트 (웹 서비스를 호출하는 화면을 통해 간접적으로 테스트)의 경우 전반적인 응답 시간 (버튼이 클릭되는 순간 순간에 클릭되는 순간 웹 서비스가 화면에 다시 표시됨) ~ ~ 27 초에서 22 초 - SaajSoapMessageFactory보다 5 초 이상 향상된 단계. 그러나 100 명의 사용자 테스트를 실행했을 때 응답 시간이 2 초 증가했으며이 경우 SaajSoapMessageFactory가 더 나은 것으로 보입니다. 누군가 스트리밍을 사용하고 건물 트리를 피하는 AxiomSoapMessageFactory에도 불구하고 성능의 차이에 대한 이유를 설명 할 수 있습니까?

+0

내 log4j의 아래 줄에 주석을 달았습니다. 문제는 해결 될 것 같습니다. # log4j.logger.org.springframework.ws.client.MessageTracing.sent = TRACE # log4j.logger.org.springframework.ws.client. MessageTracing.received = TRACE – user2253556

답변

1

payloadCaching=false은 Axiom에게 페이로드에 대한 개체 모델 트리를 빌드하지 않도록 지시합니다. 이것은 성능 향상을 가능하게하지만 페이로드에는 한 번만 액세스 할 수 있음을 의미합니다. 구형 Axiom 버전에서는 두 번째 페이로드에 액세스하려는 시도가 다소 흐릿하게 나타납니다. OMException. 최신 버전에서는 NodeUnavailableException이 표시되며 이는 Javadoc에 문서화되어 있습니다. 귀하의 의견에 언급했듯이, 귀하의 경우 페이로드는 추적 로깅에 의해 소비됩니다.