You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sc...@apache.org on 2008/04/15 22:00:19 UTC
svn commit: r648397 - in
/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message:
MessageRPCTests.java headers/ConfigBody.java headers/ObjectFactory.java
Author: scheu
Date: Tue Apr 15 13:00:18 2008
New Revision: 648397
URL: http://svn.apache.org/viewvc?rev=648397&view=rev
Log:
WSCOMMONS-321
Contributor:Rich Scheuerle
Enabled and modified test contributed by dims.
Added:
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ConfigBody.java
Modified:
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ObjectFactory.java
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java?rev=648397&r1=648396&r2=648397&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java Tue Apr 15 13:00:18 2008
@@ -28,6 +28,7 @@
import org.apache.axis2.jaxws.message.databinding.JAXBBlockContext;
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
+import org.apache.axis2.jaxws.message.headers.ConfigBody;
import org.apache.axis2.jaxws.message.headers.ConfigHeader;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.test.stock1.ObjectFactory;
@@ -250,12 +251,12 @@
}
public void testJAXBInflow_soap11() throws Exception {
- _testJAXBInflow(sampleEnvelope11);
- }
- public void testJAXBInflow_soap12() throws Exception {
- _testJAXBInflow(sampleEnvelope12);
- }
- public void _testJAXBInflow(String sampleJAXBEnvelope) throws Exception {
+ _testJAXBInflow(sampleEnvelope11);
+ }
+ public void testJAXBInflow_soap12() throws Exception {
+ _testJAXBInflow(sampleEnvelope12);
+ }
+ public void _testJAXBInflow(String sampleJAXBEnvelope) throws Exception {
// Create a SOAP OM out of the sample incoming XML. This
// simulates what Axis2 will be doing with the inbound message.
StringReader sr = new StringReader(sampleJAXBEnvelope);
@@ -314,8 +315,7 @@
assertTrue(obj.getPrice().equals("100"));
}
- // FIXME: This test fails, checking it in so that Rich can take a look
- public void _testJAXBHeader() throws Exception {
+ public void testJAXBHeader() throws Exception {
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
"\t<soapenv:Header>\n" +
@@ -327,9 +327,11 @@
"\t\t</ns2:ConfigHeader3>\n" +
"\t</soapenv:Header>\n" +
"\t<soapenv:Body>\n" +
- "\t\t<rpcOp:echoItResponse xmlns:rpcOp=\"http://headers.message.jaxws.axis2.apache.org/W2JRLR2738TestService.wsdl\">\n" +
- "\t\t\t<result xmlns:ns2=\"http://headers.message.jaxws.axis2.apache.org/types4\">Got it</result>\n" +
- "\t\t</rpcOp:echoItResponse>\n" +
+ "\t\t<rpcOp:ConfigResponse xmlns:rpcOp=\"http://headers.message.jaxws.axis2.apache.org/types4\">\n" +
+ "\t\t<rpcParam:ConfigBody xmlns:rpcParam=\"http://headers.message.jaxws.axis2.apache.org/types4\">\n" +
+ "\t\t\t<message>Got it</message>\n" +
+ "\t\t</rpcParam:ConfigBody>\n" +
+ "\t\t</rpcParam:ConfigResponse>\n" +
"\t</soapenv:Body>\n" +
"</soapenv:Envelope>";
@@ -384,7 +386,9 @@
Block block2 = m.getBodyBlock(context, bf);
Object b2 = block2.getBusinessObject(true);
-
- assertTrue(b2 instanceof String);
+ if (b2 instanceof JAXBElement) {
+ b2 = ((JAXBElement) b2).getValue();
+ }
+ assertTrue(b2 instanceof ConfigBody);
}
}
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ConfigBody.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ConfigBody.java?rev=648397&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ConfigBody.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ConfigBody.java Tue Apr 15 13:00:18 2008
@@ -0,0 +1,80 @@
+/*
+ * 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 org.apache.axis2.jaxws.message.headers;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ConfigBody complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ConfigBody">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ConfigBody", propOrder = {
+ "message"
+})
+public class ConfigBody {
+
+ @XmlElement(required = true)
+ protected String message;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+}
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ObjectFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ObjectFactory.java?rev=648397&r1=648396&r2=648397&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ObjectFactory.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/message/headers/ObjectFactory.java Tue Apr 15 13:00:18 2008
@@ -31,6 +31,7 @@
private final static QName _ConfigHeader1_QNAME = new QName("http://headers.message.jaxws.axis2.apache.org/types4", "ConfigHeader1");
private final static QName _ConfigHeader3_QNAME = new QName("http://headers.message.jaxws.axis2.apache.org/types4", "ConfigHeader3");
private final static QName _ConfigHeader2_QNAME = new QName("http://headers.message.jaxws.axis2.apache.org/types4", "ConfigHeader2");
+ private final static QName _ConfigBody_QNAME = new QName("http://headers.message.jaxws.axis2.apache.org/types4", "ConfigBody");
public ObjectFactory() {
}
@@ -42,7 +43,24 @@
public ConfigHeader createConfigHeader() {
return new ConfigHeader();
}
+
+ /**
+ * Create an instance of {@link ConfigHeader }
+ *
+ */
+ public ConfigBody createConfigBody() {
+ return new ConfigBody();
+ }
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ConfigBody }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://headers.message.jaxws.axis2.apache.org/types4", name = "ConfigBody")
+ public JAXBElement<ConfigBody> createConfigBody(ConfigBody value) {
+ return new JAXBElement<ConfigBody>(_ConfigBody_QNAME, ConfigBody.class, null, value);
+ }
+
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ConfigHeader }{@code >}}
*
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org