Added separate namespace handler for 'ws' rather than combining with the core 'integration' namespace.

This commit is contained in:
Mark Fisher
2008-09-19 22:24:44 +00:00
parent 73370d35a7
commit 6cc2c60173
8 changed files with 59 additions and 23 deletions

View File

@@ -3,12 +3,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:ws="http://www.springframework.org/schema/integration/ws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-ws-1.0.xsd
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd">
http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd
http://www.springframework.org/schema/integration/ws
http://www.springframework.org/schema/integration/ws/spring-integration-ws-1.0.xsd">
<message-bus/>
@@ -16,7 +19,7 @@
<!-- The service activator receives from the 'fahrenheitChannel', invokes the
Web Service for the given URI, and sends the reply Message to the 'celsiusChannel'. -->
<ws-service-activator id="temperatureConverter"
<ws:ws-service-activator id="temperatureConverter"
input-channel="fahrenheitChannel"
output-channel="celsiusChannel"
uri="http://www.w3schools.com/webservices/tempconvert.asmx"/>

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.ws.config;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
/**
* @author Mark Fisher
*/
public class WsNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
this.registerBeanDefinitionParser("ws-service-activator", new WebServiceHandlerParser());
}
}

View File

@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/integration"
<xsd:schema xmlns="http://www.springframework.org/schema/integration/ws"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:tool="http://www.springframework.org/schema/tool"
targetNamespace="http://www.springframework.org/schema/integration"
targetNamespace="http://www.springframework.org/schema/integration/ws"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:include schemaLocation="http://www.springframework.org/schema/integration/spring-integration-core-1.0.xsd"/>
<xsd:include schemaLocation="http://www.springframework.org/schema/integration/spring-integration-adapters-1.0.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/beans"/>
<xsd:import namespace="http://www.springframework.org/schema/tool"/>

View File

@@ -1 +0,0 @@
ws-service-activator=org.springframework.integration.ws.config.WebServiceHandlerParser

View File

@@ -0,0 +1 @@
http\://www.springframework.org/schema/integration/ws=org.springframework.integration.ws.config.WsNamespaceHandler

View File

@@ -1 +1 @@
http\://www.springframework.org/schema/integration/spring-integration-ws-1.0.xsd=org/springframework/integration/ws/config/spring-integration-ws-1.0.xsd
http\://www.springframework.org/schema/integration/ws/spring-integration-ws-1.0.xsd=org/springframework/integration/ws/config/spring-integration-ws-1.0.xsd

View File

@@ -2,37 +2,40 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:si="http://www.springframework.org/schema/integration"
xmlns:ws="http://www.springframework.org/schema/integration/ws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-ws-1.0.xsd">
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
http://www.springframework.org/schema/integration/ws
http://www.springframework.org/schema/integration/ws/spring-integration-ws-1.0.xsd">
<si:channel id="inputChannel"/>
<si:ws-service-activator id="handlerWithAllInOneMarshaller"
<ws:ws-service-activator id="handlerWithAllInOneMarshaller"
input-channel="inputChannel"
uri="http://example.org"
marshaller="marshallerAndUnmarshaller"/>
<si:ws-service-activator id="handlerWithSeparateMarshallerAndUnmarshaller"
<ws:ws-service-activator id="handlerWithSeparateMarshallerAndUnmarshaller"
input-channel="inputChannel"
uri="http://example.org"
marshaller="marshaller"
unmarshaller="unmarshaller"/>
<si:ws-service-activator id="handlerWithCustomRequestCallback"
<ws:ws-service-activator id="handlerWithCustomRequestCallback"
input-channel="inputChannel"
uri="http://example.org"
marshaller="marshallerAndUnmarshaller"
request-callback="requestCallback"/>
<si:ws-service-activator id="handlerWithAllInOneMarshallerAndMessageFactory"
<ws:ws-service-activator id="handlerWithAllInOneMarshallerAndMessageFactory"
input-channel="inputChannel"
uri="http://example.org"
marshaller="marshallerAndUnmarshaller"
message-factory="messageFactory"/>
<si:ws-service-activator id="handlerWithSeparateMarshallerAndUnmarshallerAndMessageFactory"
<ws:ws-service-activator id="handlerWithSeparateMarshallerAndUnmarshallerAndMessageFactory"
input-channel="inputChannel"
uri="http://example.org"
marshaller="marshaller"

View File

@@ -2,39 +2,42 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:si="http://www.springframework.org/schema/integration"
xmlns:ws="http://www.springframework.org/schema/integration/ws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-ws-1.0.xsd">
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
http://www.springframework.org/schema/integration/ws
http://www.springframework.org/schema/integration/ws/spring-integration-ws-1.0.xsd">
<si:channel id="inputChannel"/>
<si:ws-service-activator id="handlerWithDefaultSourceExtractor"
<ws:ws-service-activator id="handlerWithDefaultSourceExtractor"
input-channel="inputChannel"
uri="http://example.org"/>
<si:ws-service-activator id="handlerWithCustomSourceExtractor"
<ws:ws-service-activator id="handlerWithCustomSourceExtractor"
input-channel="inputChannel"
uri="http://example.org"
source-extractor="sourceExtractor"/>
<si:ws-service-activator id="handlerWithCustomRequestCallback"
<ws:ws-service-activator id="handlerWithCustomRequestCallback"
input-channel="inputChannel"
uri="http://example.org"
request-callback="requestCallback"/>
<si:ws-service-activator id="handlerWithCustomMessageFactory"
<ws:ws-service-activator id="handlerWithCustomMessageFactory"
input-channel="inputChannel"
uri="http://example.org"
message-factory="messageFactory"/>
<si:ws-service-activator id="handlerWithCustomSourceExtractorAndMessageFactory"
<ws:ws-service-activator id="handlerWithCustomSourceExtractorAndMessageFactory"
input-channel="inputChannel"
uri="http://example.org"
source-extractor="sourceExtractor"
message-factory="messageFactory"/>
<si:ws-service-activator id="handlerWithCustomFaultMessageResolver"
<ws:ws-service-activator id="handlerWithCustomFaultMessageResolver"
input-channel="inputChannel"
uri="http://example.org"
fault-message-resolver="faultMessageResolver"/>