Author: mmerz
Date: Wed Feb 23 13:48:49 2005
New Revision: 155079
URL: http://svn.apache.org/viewcvs?view=rev&rev=155079
Log:
More concrete, easier-to-read complex objects (based on Address from
AddressBook sample).
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Address.java
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressException.java
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressHolder.java
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/MessageHandler.java
- copied, changed from r154878,
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/common/MessageHandler.java
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Phone.java
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/StateType.java
Removed:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/common/
Modified:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralBareSample.jws
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralWrappedSample.jws
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/RpcLiteralSample.jws
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/handlerchain/HandlerConfig.xml
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/soapmessagehandlers/SoapMessageHandlersSample.jws
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Address.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Address.java?view=auto&rev=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Address.java
(added)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Address.java
Wed Feb 23 13:48:49 2005
@@ -0,0 +1,60 @@
+package org.apache.beehive.sample;
+
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.
+ *
+ * $Header:$
+ */
+public class Address implements java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private int streetNum;
+ private java.lang.String streetName;
+ private java.lang.String city;
+ private StateType state;
+ private int zip;
+ private Phone phoneNumber;
+
+ public Address() { }
+
+ public Address(int streetNum, String streetName, String city, StateType
state, int zip, Phone phoneNumber) {
+
+ this.streetNum = streetNum;
+ this.streetName = streetName;
+ this.city = city;
+ this.state = state;
+ this.zip = zip;
+ this.phoneNumber = phoneNumber;
+ }
+
+ public String getCity() { return city; }
+ public void setCity(String city) { this.city = city; }
+
+ public Phone getPhoneNumber() { return phoneNumber; }
+ public void setPhoneNumber(Phone phoneNumber) { this.phoneNumber =
phoneNumber; }
+
+ public StateType getState() { return state; }
+ public void setState(StateType state) { this.state = state; }
+
+ public String getStreetName() { return streetName; }
+ public void setStreetName(String streetName) { this.streetName =
streetName; }
+
+ public int getStreetNum() { return streetNum; }
+ public void setStreetNum(int streetNum) { this.streetNum = streetNum; }
+
+ public int getZip() { return zip; }
+ public void setZip(int zip) { this.zip = zip; }
+}
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressException.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressException.java?view=auto&rev=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressException.java
(added)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressException.java
Wed Feb 23 13:48:49 2005
@@ -0,0 +1,27 @@
+package org.apache.beehive.sample;
+
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.
+ *
+ * $Header:$
+ */
+
+public class AddressException extends Exception implements
java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public AddressException() { }
+ public AddressException(String msg) { super(msg); }
+}
\ No newline at end of file
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressHolder.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressHolder.java?view=auto&rev=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressHolder.java
(added)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/AddressHolder.java
Wed Feb 23 13:48:49 2005
@@ -0,0 +1,26 @@
+package org.apache.beehive.sample;
+
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.
+ *
+ * $Header:$
+ */
+
+public class AddressHolder implements javax.xml.rpc.holders.Holder,
java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public Address value;
+}
\ No newline at end of file
Copied:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/MessageHandler.java
(from r154878,
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/common/MessageHandler.java)
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/MessageHandler.java?view=diff&rev=155079&p1=incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/common/MessageHandler.java&r1=154878&p2=incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/MessageHandler.java&r2=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/common/MessageHandler.java
(original)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/MessageHandler.java
Wed Feb 23 13:48:49 2005
@@ -1,4 +1,4 @@
-package web.common;
+package org.apache.beehive.sample;
/*
* Copyright 2004, 2005 The Apache Software Foundation
@@ -87,4 +87,4 @@
public boolean handleFault(MessageContext mc) {
return true;
}
-}
\ No newline at end of file
+}
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Phone.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Phone.java?view=auto&rev=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Phone.java
(added)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/Phone.java
Wed Feb 23 13:48:49 2005
@@ -0,0 +1,46 @@
+package org.apache.beehive.sample;
+
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.
+ *
+ * $Header:$
+ */
+
+public class Phone implements java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private int areaCode;
+ private String exchange;
+ private String number;
+
+ public Phone() { super(); }
+
+ public Phone(int areaCode, String exchange, String number) {
+
+ this.areaCode = areaCode;
+ this.exchange = exchange;
+ this.number = number;
+ }
+
+ public int getAreaCode() { return areaCode; }
+ public void setAreaCode(int areaCode) { this.areaCode = areaCode; }
+
+ public String getExchange() { return exchange; }
+ public void setExchange(String exchange) { this.exchange = exchange; }
+
+ public String getNumber() { return number; }
+ public void setNumber(String number) { this.number = number; }
+}
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/StateType.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/StateType.java?view=auto&rev=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/StateType.java
(added)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/org/apache/beehive/sample/StateType.java
Wed Feb 23 13:48:49 2005
@@ -0,0 +1,33 @@
+package org.apache.beehive.sample;
+
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.
+ *
+ * $Header:$
+ */
+
+public class StateType implements java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String state;
+
+ public StateType() { }
+
+ public StateType(String state) { this.state = state; }
+
+ public String getState() { return state; }
+ public void setState(String state) { this.state = state; }
+}
Modified:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralBareSample.jws
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralBareSample.jws?view=diff&r1=155078&r2=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralBareSample.jws
(original)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralBareSample.jws
Wed Feb 23 13:48:49 2005
@@ -24,10 +24,11 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import web.common.ComplexObject;
-import web.common.ComplexException;
-import web.common.ComplexObjectHolder;
-import web.common.Value;
+import org.apache.beehive.sample.Address;
+import org.apache.beehive.sample.AddressHolder;
+import org.apache.beehive.sample.AddressException;
+import org.apache.beehive.sample.Phone;
+import org.apache.beehive.sample.StateType;
/**
* This class illustrates the use of complex types with style/use
"DOC/LITERAL" (bare).
@@ -41,94 +42,92 @@
public class DocumentLiteralBareSample {
/**
- * Returns a complex object that was passed in as IN parameter in the
message body.
- * @param object The object to be returned.
+ * Returns a complex (address) object that was passed in as IN parameter
in the message body.
+ * @param address The complex object to be returned.
* @return The complex object that was passed in as an IN parameter.
*/
@WebMethod
- @WebResult(name="ReturnComplexObjectResult")
- public ComplexObject
returnComplexObjectBody(@WebParam(name="in-param-body", mode=WebParam.Mode.IN)
ComplexObject object) {
- return object;
+ @WebResult(name="ReturnAddressFromBodyResult")
+ public Address returnAddressFromBody(@WebParam(name="in-param-body",
mode=WebParam.Mode.IN) Address address) {
+ return address;
}
/**
- * Returns a complex object that was passed in as IN parameter in the
message header.
- * @param object The object to be modified.
+ * Returns a complex (address) object that was passed in as IN parameter
in the message header.
+ * @param object The complex object to be modified.
* @return The complex object that was passed in as an IN parameter.
*/
@WebMethod
- @WebResult(name="ReturnComplexObjectResult")
- public ComplexObject
returnComplexObjectHeader(@WebParam(name="in-param-header", header=true,
mode=WebParam.Mode.IN) ComplexObject object) {
- return object;
+ @WebResult(name="ReturnAddressFromHeaderResult")
+ public Address returnAddressFromHeader(@WebParam(name="in-param-header",
header=true, mode=WebParam.Mode.IN) Address address) {
+ return address;
}
/**
- * Creates a new complex object and returns that object as an OUT
parameter that is encoded in the message body.
- * @param objectHolder The holder of the object to be returned.
- * @return A operational result (always "0").
+ * Creates a new complex (address) object and returns that object as an
OUT parameter that is encoded in the message body.
+ * @param addressHolder The holder of the complex object to be returned.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ReturnCreateComplexObjectResult")
- public int createComplexObjectBody(@WebParam(name="out-param-body",
mode=WebParam.Mode.OUT) ComplexObjectHolder objectHolder) {
- Value value = new Value("TESTVALUE");
- ComplexObject object = new ComplexObject(value);
- objectHolder.value = object;
+ @WebResult(name="ReturnCreateAddressInBodyResult")
+ public int createAddressInBody(@WebParam(name="out-param-body",
mode=WebParam.Mode.OUT) AddressHolder addressHolder) {
+ StateType state = new StateType("WA");
+ Phone phoneNumber = new Phone(425, "555", "1234");
+ Address address = new Address(10230, "NE Points Drive", "Kirkland",
state, 98008, phoneNumber);
+ addressHolder.value = address;
return 0;
}
/**
- * Creates a new complex object and returns that object as an OUT
parameter that is encoded in the message header.
- * @param objectHolder The holder of the object to be returned.
- * @return A operational result (always "0").
+ * Creates a new complex (address) object and returns that object as an
OUT parameter that is encoded in the message header.
+ * @param addressHolder The holder of the complex object to be returned.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ReturnCreateComplexObjectResult")
- public int createComplexObjectHeader(@WebParam(name="out-param-header",
header=true, mode=WebParam.Mode.OUT) ComplexObjectHolder objectHolder) {
- Value value = new Value("TESTVALUE");
- ComplexObject object = new ComplexObject(value);
- objectHolder.value = object;
+ @WebResult(name="ReturnCreateAddressInHeaderResult")
+ public int createAddressInHeader(@WebParam(name="out-param-header",
header=true, mode=WebParam.Mode.OUT) AddressHolder addressHolder) {
+ StateType state = new StateType("WA");
+ Phone phoneNumber = new Phone(425, "555", "1234");
+ Address address = new Address(10230, "NE Points Drive", "Kirkland",
state, 98008, phoneNumber);
+ addressHolder.value = address;
return 0;
}
/**
- * Modifies a complex INOUT parameter that is encoded in the message body.
- * @param complexObjectHolder The object to be modified.
- * @return A operational result (always "0").
+ * Modifies a complex (address) INOUT parameter that is encoded in the
message body.
+ * @param addressHolder The object to be modified.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ChangeComplexObjectResult")
- public int changeComplexObjectBody(@WebParam(name="inout-param-body",
mode=WebParam.Mode.INOUT) ComplexObjectHolder complexObjectHolder) {
- ComplexObject complexObject = complexObjectHolder.value;
- Value oldValue = complexObject.getValue();
- Value newValue = new Value(oldValue.getField());
- complexObject.setValue(newValue);
+ @WebResult(name="ChangeAddressInBodyResult")
+ public int changeAddressInBody(@WebParam(name="inout-param-body",
mode=WebParam.Mode.INOUT) AddressHolder addressHolder) {
+ Address address = addressHolder.value;
+ address.setZip(address.getZip() + 1);
return 0;
}
/**
- * Modifies a complex INOUT parameter that is encoded in the message
header.
- * @param complexObjectHolder The object to be modified.
- * @return A operational result (always "0").
+ * Modifies a complex (address) INOUT parameter that is encoded in the
message header.
+ * @param addressHolder The object to be modified.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ChangeComplexObjectResult")
- public int changeComplexObjectHeader(@WebParam(name="inout-param-header",
header=true, mode=WebParam.Mode.INOUT) ComplexObjectHolder complexObjectHolder)
{
- ComplexObject complexObject = complexObjectHolder.value;
- Value oldValue = complexObject.getValue();
- Value newValue = new Value(oldValue.getField());
- complexObject.setValue(newValue);
+ @WebResult(name="ChangeAddressInHeaderResult")
+ public int changeAddressInHeader(@WebParam(name="inout-param-header",
header=true, mode=WebParam.Mode.INOUT) AddressHolder addressHolder) {
+ Address address = addressHolder.value;
+ address.setZip(address.getZip() + 1);
return 0;
}
/**
- * Throws a ComplexException.
- * @param value Ignored.
- * @return A operational result (never returned).
- * @throws ComplexException Always thrown.
+ * Throws an AddressException.
+ * @param value Ignored (only printed in message).
+ * @return An operational result (never returned).
+ * @throws AddressException Always thrown.
*/
@WebMethod
- @WebResult(name="ThrowComplexExceptionResult")
- public int throwComplexException(@WebParam(name="in-param") int value)
throws ComplexException {
- throw new ComplexException("This is a sample message
for:\n\tComplexException with value=\"" + value + "\"");
+ @WebResult(name="ThrowAddressExceptionResult")
+ public int throwAddressException(@WebParam(name="in-param") int value)
throws AddressException {
+ throw new AddressException("This is a sample message
for:\n\tAddressException; input value=\"" + value + "\"");
}
}
Modified:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralWrappedSample.jws
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralWrappedSample.jws?view=diff&r1=155078&r2=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralWrappedSample.jws
(original)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/DocumentLiteralWrappedSample.jws
Wed Feb 23 13:48:49 2005
@@ -24,10 +24,11 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import web.common.ComplexObject;
-import web.common.ComplexException;
-import web.common.ComplexObjectHolder;
-import web.common.Value;
+import org.apache.beehive.sample.Address;
+import org.apache.beehive.sample.AddressHolder;
+import org.apache.beehive.sample.AddressException;
+import org.apache.beehive.sample.Phone;
+import org.apache.beehive.sample.StateType;
/**
* This class illustrates the use of complex types with style/use
"DOC/LITERAL" (wrapped).
@@ -41,94 +42,92 @@
public class DocumentLiteralWrappedSample {
/**
- * Returns a complex object that was passed in as IN parameter in the
message body.
- * @param object The object to be returned.
+ * Returns a complex (address) object that was passed in as IN parameter
in the message body.
+ * @param address The complex object to be returned.
* @return The complex object that was passed in as an IN parameter.
*/
@WebMethod
- @WebResult(name="ReturnComplexObjectResult")
- public ComplexObject
returnComplexObjectBody(@WebParam(name="in-param-body", mode=WebParam.Mode.IN)
ComplexObject object) {
- return object;
+ @WebResult(name="ReturnAddressFromBodyResult")
+ public Address returnAddressFromBody(@WebParam(name="in-param-body",
mode=WebParam.Mode.IN) Address address) {
+ return address;
}
/**
- * Returns a complex object that was passed in as IN parameter in the
message header.
- * @param object The object to be modified.
+ * Returns a complex (address) object that was passed in as IN parameter
in the message header.
+ * @param object The complex object to be modified.
* @return The complex object that was passed in as an IN parameter.
*/
@WebMethod
- @WebResult(name="ReturnComplexObjectResult")
- public ComplexObject
returnComplexObjectHeader(@WebParam(name="in-param-header", header=true,
mode=WebParam.Mode.IN) ComplexObject object) {
- return object;
+ @WebResult(name="ReturnAddressFromHeaderResult")
+ public Address returnAddressFromHeader(@WebParam(name="in-param-header",
header=true, mode=WebParam.Mode.IN) Address address) {
+ return address;
}
/**
- * Creates a new complex object and returns that object as an OUT
parameter that is encoded in the message body.
- * @param objectHolder The holder of the object to be returned.
- * @return A operational result (always "0").
+ * Creates a new complex (address) object and returns that object as an
OUT parameter that is encoded in the message body.
+ * @param addressHolder The holder of the complex object to be returned.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ReturnCreateComplexObjectResult")
- public int createComplexObjectBody(@WebParam(name="out-param-body",
mode=WebParam.Mode.OUT) ComplexObjectHolder objectHolder) {
- Value value = new Value("TESTVALUE");
- ComplexObject object = new ComplexObject(value);
- objectHolder.value = object;
+ @WebResult(name="ReturnCreateAddressInBodyResult")
+ public int createAddressInBody(@WebParam(name="out-param-body",
mode=WebParam.Mode.OUT) AddressHolder addressHolder) {
+ StateType state = new StateType("WA");
+ Phone phoneNumber = new Phone(425, "555", "1234");
+ Address address = new Address(10230, "NE Points Drive", "Kirkland",
state, 98008, phoneNumber);
+ addressHolder.value = address;
return 0;
}
/**
- * Creates a new complex object and returns that object as an OUT
parameter that is encoded in the message header.
- * @param objectHolder The holder of the object to be returned.
- * @return A operational result (always "0").
+ * Creates a new complex (address) object and returns that object as an
OUT parameter that is encoded in the message header.
+ * @param addressHolder The holder of the complex object to be returned.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ReturnCreateComplexObjectResult")
- public int createComplexObjectHeader(@WebParam(name="out-param-header",
header=true, mode=WebParam.Mode.OUT) ComplexObjectHolder objectHolder) {
- Value value = new Value("TESTVALUE");
- ComplexObject object = new ComplexObject(value);
- objectHolder.value = object;
+ @WebResult(name="ReturnCreateAddressInHeaderResult")
+ public int createAddressInHeader(@WebParam(name="out-param-header",
header=true, mode=WebParam.Mode.OUT) AddressHolder addressHolder) {
+ StateType state = new StateType("WA");
+ Phone phoneNumber = new Phone(425, "555", "1234");
+ Address address = new Address(10230, "NE Points Drive", "Kirkland",
state, 98008, phoneNumber);
+ addressHolder.value = address;
return 0;
}
/**
- * Modifies a complex INOUT parameter that is encoded in the message body.
- * @param complexObjectHolder The object to be modified.
- * @return A operational result (always "0").
+ * Modifies a complex (address) INOUT parameter that is encoded in the
message body.
+ * @param addressHolder The object to be modified.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ChangeComplexObjectResult")
- public int changeComplexObjectBody(@WebParam(name="inout-param-body",
mode=WebParam.Mode.INOUT) ComplexObjectHolder complexObjectHolder) {
- ComplexObject complexObject = complexObjectHolder.value;
- Value oldValue = complexObject.getValue();
- Value newValue = new Value(oldValue.getField());
- complexObject.setValue(newValue);
+ @WebResult(name="ChangeAddressInBodyResult")
+ public int changeAddressInBody(@WebParam(name="inout-param-body",
mode=WebParam.Mode.INOUT) AddressHolder addressHolder) {
+ Address address = addressHolder.value;
+ address.setZip(address.getZip() + 1);
return 0;
}
/**
- * Modifies a complex INOUT parameter that is encoded in the message
header.
- * @param complexObjectHolder The object to be modified.
- * @return A operational result (always "0").
+ * Modifies a complex (address) INOUT parameter that is encoded in the
message header.
+ * @param addressHolder The object to be modified.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ChangeComplexObjectResult")
- public int changeComplexObjectHeader(@WebParam(name="inout-param-header",
header=true, mode=WebParam.Mode.INOUT) ComplexObjectHolder complexObjectHolder)
{
- ComplexObject complexObject = complexObjectHolder.value;
- Value oldValue = complexObject.getValue();
- Value newValue = new Value(oldValue.getField());
- complexObject.setValue(newValue);
+ @WebResult(name="ChangeAddressInHeaderResult")
+ public int changeAddressInHeader(@WebParam(name="inout-param-header",
header=true, mode=WebParam.Mode.INOUT) AddressHolder addressHolder) {
+ Address address = addressHolder.value;
+ address.setZip(address.getZip() + 1);
return 0;
}
/**
- * Throws a ComplexException.
- * @param value Ignored.
- * @return A operational result (never returned).
- * @throws ComplexException Always thrown.
+ * Throws an AddressException.
+ * @param value Ignored (only printed in message).
+ * @return An operational result (never returned).
+ * @throws AddressException Always thrown.
*/
@WebMethod
- @WebResult(name="ThrowComplexExceptionResult")
- public int throwComplexException(@WebParam(name="in-param") int value)
throws ComplexException {
- throw new ComplexException("This is a sample message
for:\n\tComplexException with value=\"" + value + "\"");
+ @WebResult(name="ThrowAddressExceptionResult")
+ public int throwAddressException(@WebParam(name="in-param") int value)
throws AddressException {
+ throw new AddressException("This is a sample message
for:\n\tAddressException; input value=\"" + value + "\"");
}
}
Modified:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/RpcLiteralSample.jws
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/RpcLiteralSample.jws?view=diff&r1=155078&r2=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/RpcLiteralSample.jws
(original)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/complex/RpcLiteralSample.jws
Wed Feb 23 13:48:49 2005
@@ -24,10 +24,11 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import web.common.ComplexObject;
-import web.common.ComplexException;
-import web.common.ComplexObjectHolder;
-import web.common.Value;
+import org.apache.beehive.sample.Address;
+import org.apache.beehive.sample.AddressHolder;
+import org.apache.beehive.sample.AddressException;
+import org.apache.beehive.sample.Phone;
+import org.apache.beehive.sample.StateType;
/**
* This class illustrates the use of complex types with style/use
"RPC/LITERAL".
@@ -40,94 +41,92 @@
public class RpcLiteralSample {
/**
- * Returns a complex object that was passed in as IN parameter in the
message body.
- * @param object The object to be returned.
+ * Returns a complex (address) object that was passed in as IN parameter
in the message body.
+ * @param address The complex object to be returned.
* @return The complex object that was passed in as an IN parameter.
*/
@WebMethod
- @WebResult(name="ReturnComplexObjectResult")
- public ComplexObject
returnComplexObjectBody(@WebParam(name="in-param-body", mode=WebParam.Mode.IN)
ComplexObject object) {
- return object;
+ @WebResult(name="ReturnAddressFromBodyResult")
+ public Address returnAddressFromBody(@WebParam(name="in-param-body",
mode=WebParam.Mode.IN) Address address) {
+ return address;
}
/**
- * Returns a complex object that was passed in as IN parameter in the
message header.
- * @param object The object to be modified.
+ * Returns a complex (address) object that was passed in as IN parameter
in the message header.
+ * @param object The complex object to be modified.
* @return The complex object that was passed in as an IN parameter.
*/
@WebMethod
- @WebResult(name="ReturnComplexObjectResult")
- public ComplexObject
returnComplexObjectHeader(@WebParam(name="in-param-header", header=true,
mode=WebParam.Mode.IN) ComplexObject object) {
- return object;
+ @WebResult(name="ReturnAddressFromHeaderResult")
+ public Address returnAddressFromHeader(@WebParam(name="in-param-header",
header=true, mode=WebParam.Mode.IN) Address address) {
+ return address;
}
/**
- * Creates a new complex object and returns that object as an OUT
parameter that is encoded in the message body.
- * @param objectHolder The holder of the object to be returned.
- * @return A operational result (always "0").
+ * Creates a new complex (address) object and returns that object as an
OUT parameter that is encoded in the message body.
+ * @param addressHolder The holder of the complex object to be returned.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ReturnCreateComplexObjectResult")
- public int createComplexObjectBody(@WebParam(name="out-param-body",
mode=WebParam.Mode.OUT) ComplexObjectHolder objectHolder) {
- Value value = new Value("TESTVALUE");
- ComplexObject object = new ComplexObject(value);
- objectHolder.value = object;
+ @WebResult(name="ReturnCreateAddressInBodyResult")
+ public int createAddressInBody(@WebParam(name="out-param-body",
mode=WebParam.Mode.OUT) AddressHolder addressHolder) {
+ StateType state = new StateType("WA");
+ Phone phoneNumber = new Phone(425, "555", "1234");
+ Address address = new Address(10230, "NE Points Drive", "Kirkland",
state, 98008, phoneNumber);
+ addressHolder.value = address;
return 0;
}
/**
- * Creates a new complex object and returns that object as an OUT
parameter that is encoded in the message header.
- * @param objectHolder The holder of the object to be returned.
- * @return A operational result (always "0").
+ * Creates a new complex (address) object and returns that object as an
OUT parameter that is encoded in the message header.
+ * @param addressHolder The holder of the complex object to be returned.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ReturnCreateComplexObjectResult")
- public int createComplexObjectHeader(@WebParam(name="out-param-header",
header=true, mode=WebParam.Mode.OUT) ComplexObjectHolder objectHolder) {
- Value value = new Value("TESTVALUE");
- ComplexObject object = new ComplexObject(value);
- objectHolder.value = object;
+ @WebResult(name="ReturnCreateAddressInHeaderResult")
+ public int createAddressInHeader(@WebParam(name="out-param-header",
header=true, mode=WebParam.Mode.OUT) AddressHolder addressHolder) {
+ StateType state = new StateType("WA");
+ Phone phoneNumber = new Phone(425, "555", "1234");
+ Address address = new Address(10230, "NE Points Drive", "Kirkland",
state, 98008, phoneNumber);
+ addressHolder.value = address;
return 0;
}
/**
- * Modifies a complex INOUT parameter that is encoded in the message body.
- * @param complexObjectHolder The object to be modified.
- * @return A operational result (always "0").
+ * Modifies a complex (address) INOUT parameter that is encoded in the
message body.
+ * @param addressHolder The object to be modified.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ChangeComplexObjectResult")
- public int changeComplexObjectBody(@WebParam(name="inout-param-body",
mode=WebParam.Mode.INOUT) ComplexObjectHolder complexObjectHolder) {
- ComplexObject complexObject = complexObjectHolder.value;
- Value oldValue = complexObject.getValue();
- Value newValue = new Value(oldValue.getField());
- complexObject.setValue(newValue);
+ @WebResult(name="ChangeAddressInBodyResult")
+ public int changeAddressInBody(@WebParam(name="inout-param-body",
mode=WebParam.Mode.INOUT) AddressHolder addressHolder) {
+ Address address = addressHolder.value;
+ address.setZip(address.getZip() + 1);
return 0;
}
/**
- * Modifies a complex INOUT parameter that is encoded in the message
header.
- * @param complexObjectHolder The object to be modified.
- * @return A operational result (always "0").
+ * Modifies a complex (address) INOUT parameter that is encoded in the
message header.
+ * @param addressHolder The object to be modified.
+ * @return An operational result (always 0).
*/
@WebMethod
- @WebResult(name="ChangeComplexObjectResult")
- public int changeComplexObjectHeader(@WebParam(name="inout-param-header",
header=true, mode=WebParam.Mode.INOUT) ComplexObjectHolder complexObjectHolder)
{
- ComplexObject complexObject = complexObjectHolder.value;
- Value oldValue = complexObject.getValue();
- Value newValue = new Value(oldValue.getField());
- complexObject.setValue(newValue);
+ @WebResult(name="ChangeAddressInHeaderResult")
+ public int changeAddressInHeader(@WebParam(name="inout-param-header",
header=true, mode=WebParam.Mode.INOUT) AddressHolder addressHolder) {
+ Address address = addressHolder.value;
+ address.setZip(address.getZip() + 1);
return 0;
}
/**
- * Throws a ComplexException.
- * @param value Ignored.
- * @return A operational result (never returned).
- * @throws ComplexException Always thrown.
+ * Throws an AddressException.
+ * @param value Ignored (only printed in message).
+ * @return An operational result (never returned).
+ * @throws AddressException Always thrown.
*/
@WebMethod
- @WebResult(name="ThrowComplexExceptionResult")
- public int throwComplexException(@WebParam(name="in-param") int value)
throws ComplexException {
- throw new ComplexException("This is a sample message
for:\n\tComplexException with value=\"" + value + "\"");
+ @WebResult(name="ThrowAddressExceptionResult")
+ public int throwAddressException(@WebParam(name="in-param") int value)
throws AddressException {
+ throw new AddressException("This is a sample message
for:\n\tAddressException; input value=\"" + value + "\"");
}
}
Modified:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/handlerchain/HandlerConfig.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/handlerchain/HandlerConfig.xml?view=diff&r1=155078&r2=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/handlerchain/HandlerConfig.xml
(original)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/handlerchain/HandlerConfig.xml
Wed Feb 23 13:48:49 2005
@@ -6,7 +6,7 @@
<handler-chain-name>HandlerChain</handler-chain-name>
<handler>
<local:handler-name>message-handler</local:handler-name>
- <local:handler-class>web.common.MessageHandler</local:handler-class>
+
<local:handler-class>org.apache.beehive.sample.MessageHandler</local:handler-class>
<init-param>
<param-name>original</param-name>
<param-name>original</param-name>
Modified:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/soapmessagehandlers/SoapMessageHandlersSample.jws
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/soapmessagehandlers/SoapMessageHandlersSample.jws?view=diff&r1=155078&r2=155079
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/soapmessagehandlers/SoapMessageHandlersSample.jws
(original)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/soapmessagehandlers/SoapMessageHandlersSample.jws
Wed Feb 23 13:48:49 2005
@@ -27,7 +27,7 @@
@WebService(targetNamespace="http://beehive.apache.org/wsm/web")
@SOAPMessageHandlers({
@SOAPMessageHandler(
- className = "web.common.MessageHandler",
+ className = "org.apache.beehive.sample.MessageHandler",
initParams = {
@InitParam(name="original", value="original"),
@InitParam(name="modified", value="oRiGiNaL")