0

ws:outbound-gateway を使用して、Spring 統合から Web サービス (spring-ws) を呼び出そうとしています。oxm マッピングに jaxb2marshaller を使用しました。最初に jms:inbound-channel-adapter を使用して入力オブジェクトを受け取り、それを JAXBElement(Sample) に変換しました。ここで、Sample は WS-XSD スキーマから JAXB によって生成されます。オブジェクトファクトリは、JAXBElement を取得するために使用されます。

実行時にエラー Internal Server error[500] at client(Spring-Integration) を受け取ります。そして、サービス終了時 (Spring-WS) がスローされます。無効な文字 '-' が見つかりました。'>' が必要です。同じサービス (Spring-ws) が正常に動作し、Axis-2 クライアントで適切に応答します。したがって、サービス終了に問題はなく、クライアントから送信されたメッセージ (Spring-integration) は不適切であると想定しています。

これを行う適切な方法があるかどうか、または何か不足している場合は、私に提案してください

Spring_integration クライアント

<int:channel id="wsChainInboundChannel"/>
<int:chain input-channel="wsChainInboundChannel" output-channel="wsInboundChannel">
    <int:transformer ref="jms2wsTransform" method="jmsOrderToWSEmployee"/>
</int:chain>
<int:channel id="wsInboundChannel"/>
<int-ws:outbound-gateway id="wsOutboundGateway" request-channel="wsInboundChannel" uri="http://localhost:8081/mywebservice/servicelayer"
  marshaller="masterdatajaxb2Marshaller" unmarshaller="masterdatajaxb2Marshaller"
  reply-channel="wsOutboundChannel" message-factory="messageFactory"/>

 <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"/>
    </property>
</bean>

<int:channel id="wsOutboundChannel"/>

jms2wsTransform の jmsOrderToWSEmployee メソッドは

public class WS2JMSTransformer {
private final ObjectFactory jaxbFactory = new ObjectFactory();

public JAXBElement<TEmployeeBySecurityRequest> jmsOrderToWSEmployee(Message<Order> message){
    Order order = message.getPayload();
    TEmployeeBySecurityRequest request = new TEmployeeBySecurityRequest();
    request.setEmployeeId(order.getOrderQuantity().longValue());
    return jaxbFactory.createEmployeeBySecurityRequest(request);
}
}

TCP モニターでは正常に実行されるリクエスト SOAP は

--MIMEBoundary_57eb271a7b65c0bacefa0a80da1b203d0661422ab29d24a3
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.47eb271a7b65c0bacefa0a80da1b203d0661422ab29d24a3@apache.org>

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>  
<ns1:employeeBySecurity_Request xmlns:ns1="http://com/clickandbuy/mywebservice/">   
<ns1:employeeId>12312</ns1:employeeId></ns1:employeeBySecurity_Request></soapenv:Body> 
</soapenv:Envelope>
--MIMEBoundary_57eb271a7b65c0bacefa0a80da1b203d0661422ab29d24a3--

そしてSpring_integartionクライアントのSOAP(エラー1)では、

------=_Part_0_157378300.1372091736608
Content-Type: application/xop+xml; charset=utf-8; type="text/xml"

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-  
ENV:Header/><SOAP-ENV:Body><ns2:employeeBySecurity_Request   
xmlns:ns2="http://com/clickandbuy/mywebservice/"><ns2:employeeId>6</ns2:employeeId>
</ns2:employeeBySecurity_Request></SOAP-ENV:Body></SOAP-ENV:Envelope>
------=_Part_0_157378300.1372091736608--

私は、 ?xml version='1.0' encoding='UTF-8'?> およびその他のいくつかの欠落を観察しました。これを解決する方法はありますか

ありがとう

4

1 に答える 1