Author: ffang
Date: Sun Sep 17 20:56:46 2006
New Revision: 447222
URL: http://svn.apache.org/viewvc?view=rev&rev=447222
Log:
[JIRA CXF-86] add soap_header demo
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt
(with props)
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
(with props)
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java
(with props)
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java
(with props)
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java
(with props)
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
(with props)
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt?view=auto&rev=447222
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt
(added)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt
Sun Sep 17 20:56:46 2006
@@ -0,0 +1,158 @@
+SOAP Headers
+============
+
+This demo illustrates celtixfire's support for SOAP headers. In the
+WSDL file, the SOAP header is included as an additiona part within
+message and binding definitions. With this approach to defining a
+SOAP header, celtixfire treats the header content as another parameter
+to the operation. Consequently, the header content is simply
+manipulated within the method body.
+
+The client application creates the header content, which is simply
+a string value. The server application views the supplied values
+and may set these values into the operation's return values or
+out/inout headers.
+
+Please review the README in the samples directory before
+continuing.
+
+
+
+Prerequisite
+------------
+
+If your environment already includes cxf.jar on the
+CLASSPATH, and the JDK and ant bin directories on the PATH
+it is not necessary to run the environment script described in
+the samples directory README. If your environment is not
+properly configured, or if you are planning on using wsdl2java,
+javac, and java to build and run the demos, you must set the
+environment by running the script.
+
+
+
+Building and running the demo using ant
+---------------------------------------
+
+From the samples/soap_header directory, the ant build script
+can be used to build and run the demo.
+
+Using either UNIX or Windows:
+
+ ant build
+ ant server
+ ant client
+
+
+To remove the code generated from the WSDL file and the .class
+files, run:
+
+ ant clean
+
+
+
+Buildng the demo using wsdl2java and javac
+------------------------------------------
+
+From the samples/soap_header directory, first create the target
+directory build/classes and then generate code from the WSDL file.
+
+For UNIX:
+ mkdir -p build/classes
+
+ wsdl2java -d build/classes -compile ./wsdl/soap_header.wsdl
+
+For Windows:
+ mkdir build\classes
+ Must use back slashes.
+
+ wsdl2java -d build\classes -compile .\wsdl\soap_header.wsdl
+ May use either forward or back slashes.
+
+Now compile the provided client and server applications with the commands:
+
+For UNIX:
+
+ export CLASSPATH=$CLASSPATH:$CXF_HOME/lib/cxf.jar:./build/classes
+ javac -d build/classes src/demo/soap_header/client/*.java
+ javac -d build/classes src/demo/soap_header/server/*.java
+
+For Windows:
+ set classpath=%classpath%;%CXF_HOME%\lib\cxf.jar;.\build\classes
+ javac -d build\classes src\demo\soap_header\client\*.java
+ javac -d build\classes src\demo\soap_header\server\*.java
+
+Running the demo using java
+---------------------------
+
+From the samples/soap_header directory run the commands, entered on a
+single command line:
+
+For UNIX (must use forward slashes):
+ java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
+ demo.soap_header.server.Server &
+
+ java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
+ demo.soap_header.client.Client ./wsdl/soap_header.wsdl
+
+The server process starts in the background. After running the client,
+use the kill command to terminate the server process.
+
+For Windows (may use either forward or back slashes):
+ start
+ java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
+ demo.soap_header.server.Server
+
+ java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
+ demo.soap_header.client.Client .\wsdl\soap_header.wsdl
+
+A new command windows opens for the server process. After running the
+client, terminate the server process by issuing Ctrl-C in its command window.
+
+To remove the code generated from the WSDL file and the .class
+files, either delete the build directory and its contents or run:
+
+ ant clean
+
+
+
+Building and running the demo in a servlet container
+----------------------------------------------------
+
+From the samples/soap_header directory, the ant build script
+can be used to create the war file that is deployed into the
+servlet container.
+
+Build the war file with the command:
+
+ ant war
+
+
+The war file will be included in the directory
+samples/soap_header/build/war. Simply copy the war file into
+the servlet container's deployment directory. For example,
+with Tomcat copy the war file into the directory
+<installationDirectory>/webapps. The servlet container will
+extract the war and deploy the application.
+
+Using ant, run the client application with the command:
+
+ ant client-servlet -Dbase.url=http://localhost:#
+
+Where # is the TCP/IP port used by the servlet container,
+e.g., 8080.
+
+Using java, run the client application with the command:
+
+ For UNIX:
+
+ java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
+ demo.hw.client.Client http://localhost:#/soapheader/cxf/soap_header
+
+ For Windows:
+
+ java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
+ demo.hw.client.Client http://localhost:#/soapheader/cxf/soap_header
+
+Where # is the TCP/IP port used by the servlet container,
+e.g., 8080.
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml?view=auto&rev=447222
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
(added)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
Sun Sep 17 20:56:46 2006
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+
+<project name="soap header demo" default="build" basedir=".">
+
+ <import file="../common_build.xml"/>
+
+ <target name="client" description="run demo client" depends="build">
+ <property name="param" value=""/>
+ <cxfrun classname="demo.soap_header.client.Client"
param1="${basedir}/wsdl/soap_header.wsdl" param2="${op}" param3="${param}"/>
+ </target>
+
+ <target name="server" description="run demo server" depends="build">
+ <cxfrun classname="demo.soap_header.server.Server"
param1="${basedir}/wsdl/soap_header.wsdl"/>
+ </target>
+
+ <target name="generate.code">
+ <echo level="info" message="Generating code using wsdl2java..."/>
+ <wsdl2java file="soap_header.wsdl"/>
+ </target>
+
+
+</project>
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java?view=auto&rev=447222
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java
(added)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java
Sun Sep 17 20:56:46 2006
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 demo.soap_header.client;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import org.apache.headers.HeaderService;
+import org.apache.headers.HeaderTester;
+import org.apache.headers.InHeader;
+import org.apache.headers.InHeaderResponse;
+import org.apache.headers.InoutHeader;
+import org.apache.headers.InoutHeaderResponse;
+import org.apache.headers.OutHeader;
+import org.apache.headers.OutHeaderResponse;
+import org.apache.headers.SOAPHeaderData;
+
+public final class Client {
+
+ private static final QName SERVICE_NAME
+ = new QName("http://apache.org/headers", "HeaderService");
+
+
+ private Client() {
+ }
+
+ public static void main(String args[]) throws Exception {
+
+ if (args.length == 0) {
+ System.out.println("please specify wsdl");
+ System.exit(1);
+ }
+
+ URL wsdlURL;
+ File wsdlFile = new File(args[0]);
+ if (wsdlFile.exists()) {
+ wsdlURL = wsdlFile.toURL();
+ } else {
+ wsdlURL = new URL(args[0]);
+ }
+
+ HeaderService hs = new HeaderService(wsdlURL, SERVICE_NAME);
+ HeaderTester proxy = hs.getSoapPort();
+
+ invokeInHeader(proxy);
+ invokeOutHeader(proxy);
+ invokeInOutHeader(proxy);
+ }
+
+ private static void invokeInHeader(HeaderTester proxy) {
+ // invoke inHeader operation
+ System.out.println("Invoking inHeader operation");
+ InHeader me = new InHeader();
+ me.setRequestType("CXF user");
+ SOAPHeaderData headerInfo = new SOAPHeaderData();
+ headerInfo.setOriginator("CXF client");
+ headerInfo.setMessage("Invoking inHeader operation");
+ InHeaderResponse response = proxy.inHeader(me, headerInfo);
+ System.out.println("\tinHeader invocation returned: ");
+ System.out.println("\t\tResult: " + response.getResponseType());
+ }
+
+ private static void invokeOutHeader(HeaderTester proxy) {
+ // invoke outHeaderoperation
+ System.out.println("Invoking outHeader operation");
+ OutHeader me = new OutHeader();
+ me.setRequestType("CXF user");
+ Holder<OutHeaderResponse> theResponse = new
Holder<OutHeaderResponse>();
+ Holder<SOAPHeaderData> headerInfo = new Holder<SOAPHeaderData>();
+ proxy.outHeader(me, theResponse, headerInfo);
+ System.out.println("\toutHeader invocation returned: ");
+ System.out.println("\t\tOut parameter: " +
theResponse.value.getResponseType());
+ System.out.println("\t\tHeader content:");
+ System.out.println("\t\t\tOriginator: " +
headerInfo.value.getOriginator());
+ System.out.println("\t\t\tMessage: " + headerInfo.value.getMessage());
+ }
+
+ private static void invokeInOutHeader(HeaderTester proxy) {
+ System.out.println("Inovking inoutHeader operation");
+ InoutHeader me = new InoutHeader();
+ me.setRequestType("CXF user");
+ Holder<SOAPHeaderData> headerInfo = new Holder<SOAPHeaderData>();
+ SOAPHeaderData shd = new SOAPHeaderData();
+ shd.setOriginator("CXF client");
+ shd.setMessage("Inovking inoutHeader operation");
+ headerInfo.value = shd;
+ InoutHeaderResponse response = proxy.inoutHeader(me, headerInfo);
+ System.out.println("\tinoutHeader invocation returned: ");
+ System.out.println("\t\tResult: " + response.getResponseType());
+ System.out.println("\t\tHeader content:");
+ System.out.println("\t\t\tOriginator: " +
headerInfo.value.getOriginator());
+ System.out.println("\t\t\tMessage: " + headerInfo.value.getMessage());
+
+ System.exit(0);
+ }
+}
+
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/client/Client.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java?view=auto&rev=447222
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java
(added)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java
Sun Sep 17 20:56:46 2006
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 demo.soap_header.server;
+
+import javax.xml.ws.Holder;
+import org.apache.headers.HeaderTester;
+import org.apache.headers.InHeader;
+import org.apache.headers.InHeaderResponse;
+import org.apache.headers.InoutHeader;
+import org.apache.headers.InoutHeaderResponse;
+import org.apache.headers.OutHeader;
+import org.apache.headers.OutHeaderResponse;
+import org.apache.headers.SOAPHeaderData;
+
+
[EMAIL PROTECTED](serviceName = "HeaderService",
+ portName = "SoapPort",
+ endpointInterface = "org.apache.headers.HeaderTester",
+ targetNamespace = "http://apache.org/headers")
+
+
+public class HeaderTesterImpl implements HeaderTester {
+
+ public InHeaderResponse inHeader(InHeader me,
+ SOAPHeaderData headerInfo) {
+ System.out.println("inHeader invoked");
+
+ System.out.println("\tGetting Originator: " +
headerInfo.getOriginator());
+ System.out.println("\tGetting Message: " + headerInfo.getMessage());
+
+ InHeaderResponse ihr = new InHeaderResponse();
+ ihr.setResponseType("Hello " + me.getRequestType());
+ return ihr;
+ }
+
+ public void outHeader(OutHeader me,
+ Holder<OutHeaderResponse> theResponse,
+ Holder<SOAPHeaderData> headerInfo) {
+ System.out.println("outHeader invoked");
+
+ System.out.println("\tSetting originator: Celtix server");
+ System.out.println("\tSetting message: outHeader invocation
succeeded");
+
+ SOAPHeaderData sh = new SOAPHeaderData();
+ sh.setOriginator("Celtix server");
+ sh.setMessage("outHeader invocation succeeded");
+ headerInfo.value = sh;
+
+ OutHeaderResponse ohr = new OutHeaderResponse();
+ ohr.setResponseType("Hello " + me.getRequestType());
+ theResponse.value = ohr;
+ }
+
+ public InoutHeaderResponse inoutHeader(InoutHeader me,
+ Holder<SOAPHeaderData> headerInfo) {
+ System.out.println("inoutHeader invoked");
+
+ System.out.println("\tGetting Originator: " +
headerInfo.value.getOriginator());
+ System.out.println("\tGetting Message: " +
headerInfo.value.getMessage());
+
+ System.out.println("\tSetting originator: Celtix server");
+ System.out.println("\tSetting message: inoutHeader invocation
succeeded");
+
+ headerInfo.value.setOriginator("Celtix server");
+ headerInfo.value.setMessage("inoutHeader invocation succeeded");
+
+ InoutHeaderResponse iohr = new InoutHeaderResponse();
+ iohr.setResponseType("Hello " + me.getRequestType());
+
+ return iohr;
+ }
+}
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/HeaderTesterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java?view=auto&rev=447222
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java
(added)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java
Sun Sep 17 20:56:46 2006
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 demo.soap_header.server;
+
+import javax.xml.ws.Endpoint;
+
+public class Server {
+
+ protected Server() throws Exception {
+ System.out.println("Starting Server");
+
+ Object implementor = new HeaderTesterImpl();
+ String address = "http://localhost:9000/headers";
+ Endpoint.publish(address, implementor);
+ }
+
+ public static void main(String args[]) throws Exception {
+ new Server();
+ System.out.println("Server ready...");
+
+ Thread.sleep(5 * 60 * 1000);
+ System.out.println("Server exiting");
+ System.exit(0);
+ }
+}
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/src/demo/soap_header/server/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl?view=auto&rev=447222
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
(added)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
Sun Sep 17 20:56:46 2006
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+
+<definitions name="soap_header" targetNamespace="http://apache.org/headers"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/headers"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <types>
+ <schema targetNamespace="http://apache.org/headers"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <complexType name="SOAPHeaderData">
+ <sequence>
+ <element maxOccurs="1" minOccurs="1" name="originator"
type="string"/>
+ <element maxOccurs="1" minOccurs="1" name="message"
type="string"/>
+ </sequence>
+ </complexType>
+ <element name="SOAPHeaderInfo" type="tns:SOAPHeaderData"/>
+
+ <element name="inHeader">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="inHeaderResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="outHeader">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="outHeaderResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="inoutHeader">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="inoutHeaderResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </types>
+
+ <message name="inHeaderRequest">
+ <part element="tns:inHeader" name="me"/>
+ <part element="tns:SOAPHeaderInfo" name="header_info"/>
+ </message>
+ <message name="inHeaderResponse">
+ <part element="tns:inHeaderResponse" name="the_response"/>
+ </message>
+ <message name="outHeaderRequest">
+ <part element="tns:outHeader" name="me"/>
+ </message>
+ <message name="outHeaderResponse">
+ <part element="tns:outHeaderResponse" name="the_response"/>
+ <part element="tns:SOAPHeaderInfo" name="header_info"/>
+ </message>
+ <message name="inoutHeaderRequest">
+ <part element="tns:inoutHeader" name="me"/>
+ <part element="tns:SOAPHeaderInfo" name="header_info"/>
+ </message>
+ <message name="inoutHeaderResponse">
+ <part element="tns:inoutHeaderResponse" name="the_response"/>
+ <part element="tns:SOAPHeaderInfo" name="header_info"/>
+ </message>
+
+ <portType name="headerTester">
+ <operation name="inHeader">
+ <input message="tns:inHeaderRequest" name="inHeaderRequest"/>
+ <output message="tns:inHeaderResponse" name="inHeaderResponse"/>
+ </operation>
+ <operation name="outHeader">
+ <input message="tns:outHeaderRequest" name="outHeaderRequest"/>
+ <output message="tns:outHeaderResponse" name="outHeaderResponse"/>
+ </operation>
+ <operation name="inoutHeader">
+ <input message="tns:inoutHeaderRequest" name="inoutHeaderRequest"/>
+ <output message="tns:inoutHeaderResponse"
name="inoutHeaderResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="headerTesterSOAPBinding" type="tns:headerTester">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="inHeader">
+ <soap:operation soapAction="" style="document"/>
+ <input name="inHeaderRequest">
+ <soap:body parts="me" use="literal"/>
+ <soap:header message="tns:inHeaderRequest" part="header_info"
+ use="literal"/>
+ </input>
+ <output name="inHeaderResponse">
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="outHeader">
+ <soap:operation soapAction="" style="document"/>
+ <input name="outHeaderRequest">
+ <soap:body use="literal"/>
+ </input>
+ <output name="outHeaderResponse">
+ <soap:body parts="the_response" use="literal"/>
+ <soap:header message="tns:outHeaderResponse"
part="header_info"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="inoutHeader">
+ <soap:operation soapAction="" style="document"/>
+ <input name="inoutHeaderRequest">
+ <soap:body parts="me" use="literal"/>
+ <soap:header message="tns:inoutHeaderRequest"
part="header_info"
+ use="literal"/>
+ </input>
+ <output name="inoutHeaderResponse">
+ <soap:body parts="the_response" use="literal"/>
+ <soap:header message="tns:inoutHeaderResponse"
part="header_info"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="HeaderService">
+ <port binding="tns:headerTesterSOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:9000/headers"/>
+ </port>
+ </service>
+</definitions>
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/wsdl/soap_header.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java?view=diff&rev=447222&r1=447221&r2=447222
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
Sun Sep 17 20:56:46 2006
@@ -134,9 +134,9 @@
}
private List<Object> abstractParamsFromHeader(Element headerElement,
Endpoint ep, Message message) {
-
List<Object> paramInHeader = new ArrayList<Object>();
List<MessagePartInfo> parts = null;
+ List<Element> elemInHeader = new ArrayList<Element>();
for (BindingOperationInfo bop :
ep.getEndpointInfo().getBinding().getOperations()) {
if (isRequestor(message)) {
@@ -155,7 +155,9 @@
&&
nodeList.item(i).getLocalName().equals(
mpi.getElementQName().getLocalPart())) {
Element param = (Element) nodeList.item(i);
-
paramInHeader.add(getNodeDataReader(message).read(param));
+ if (!elemInHeader.contains(param)) {
+ elemInHeader.add(param);
+ }
}
}
@@ -165,6 +167,10 @@
}
}
+ for (Iterator iter = elemInHeader.iterator(); iter.hasNext();) {
+ Element element = (Element)iter.next();
+ paramInHeader.add(getNodeDataReader(message).read(element));
+ }
return paramInHeader;
}
}