Spring WS Jboss 空请求、空响应和 isSameNode 故障问题

Spring WS Jboss Empty request, empty response & isSameNode fault issue

在 jboss

中击中我的 camel-spring-ws 时出现以下错误
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header></env:Header>
<env:Body>
    <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
        <faultcode xmlns:valueNS='http://schemas.xmlsoap.org/soap/envelope/'>valueNS:Server</faultcode>
        <faultstring xml:lang='en'>isSameNode</faultstring>
    </env:Fault>
</env:Body>

同一个 war 在不同的 jboss 服务器上工作正常。

JBoss 使用的服务器:5.0

根据文档:

Returns whether this node is the same node as the given one. This method provides a way to determine whether two Node references returned by the implementation reference the same object. When two Node references are references to the same object, even if through a proxy, the references may be used completely interchangeably, such that all attributes have the same values and calling the same DOM method on either reference always has exactly the same effect.

任何人都可以告诉我问题是什么与 jboss 和 spring ws.我在日志中没有看到任何内容。

样品要求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:off="http://services.dnb.com/OfficerProductServiceV1.0">
<soapenv:Header/>
<soapenv:Body>
  <off:OfficerSearchRequest>
     <OfficerSearchRequestDetail>
        <InquiryDetail>
           <OfficerName>
              <LastName>HAR</LastName>
           </OfficerName>
           <OfficerAddress>
               <PrimaryTownName>Test</PrimaryTownName>
            </OfficerAddress>
           <IncludeResignedIndicator>true</IncludeResignedIndicator>
           <OfficerType>DIS</OfficerType>
        </InquiryDetail>
        <InquiryReferenceDetail>
           <!--0 to 5 repetitions:-->
           <CustomerReferenceText>fwe2311</CustomerReferenceText>
           <CustomerReferenceText>ad4234es</CustomerReferenceText>
           <!--Optional:-->
           <CustomerBillingEndorsementText>test</CustomerBillingEndorsementText>
        </InquiryReferenceDetail>
     </OfficerSearchRequestDetail>
  </off:OfficerSearchRequest>

问题是 Jboss 个错误的肥皂罐导致空请求被发送到 spring-ws。

纠正问题。

添加以下bean配置强制在spring-ws-servlet.xml文件

中使用sun的saaj实现
<!-- force use of Sun SAAJ implementation -->
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
    <property name="messageFactory">
        <bean
            class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"></bean>
    </property>
</bean>

Jboss 没有从 jdk 1.6 中获取 saaj。因此,您必须将以下依赖项添加到 pom.xml 文件

  <dependency>
    <groupId>javax.xml.soap</groupId>
    <artifactId>saaj-api</artifactId>
    <version>1.3</version>
  </dependency>
  <dependency>
    <groupId>com.sun.xml.messaging.saaj</groupId>
    <artifactId>saaj-impl</artifactId>
    <version>1.3</version>
  </dependency>