KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > sandesha > ws > rm > FaultCode


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17 package org.apache.sandesha.ws.rm;
18
19 import org.apache.axis.message.MessageElement;
20 import org.apache.sandesha.Constants;
21
22 import javax.xml.soap.SOAPException JavaDoc;
23
24 public class FaultCode extends MessageElement implements IRmElement {
25
26     /**
27      * Field lastMsgElement
28      */

29     private MessageElement faultCode;
30
31     /**
32      * Constructor LastMessage
33      */

34     public FaultCode() {
35         faultCode = new MessageElement();
36         faultCode.setName(Constants.WSRM.NS_PREFIX_RM + Constants.COLON + Constants.WSRM.FAULT_CODE);
37     }
38
39     /**
40      * Method getSoapElement
41      *
42      * @return MessageElement
43      */

44     public MessageElement getSoapElement() {
45         return faultCode;
46     }
47
48     /**
49      * Method fromSOAPEnvelope
50      *
51      * @param element
52      * @return LastMessage
53      */

54     public FaultCode fromSOAPEnvelope(MessageElement element) {
55         return this;
56     }
57
58     /**
59      * Method toSOAPEnvelope
60      *
61      * @param msgElement
62      * @return MessageElement
63      * @throws SOAPException
64      */

65     public MessageElement toSOAPEnvelope(MessageElement msgElement) throws SOAPException JavaDoc {
66         msgElement.addChildElement(Constants.WSRM.FAULT_CODE, Constants.WSRM.NS_PREFIX_RM);
67         return msgElement;
68     }
69
70     /**
71      * Method addChildElement
72      *
73      * @param element
74      */

75     public void addChildElement(MessageElement element) {
76
77         // no child elements in LastMessage element
78
}
79
80
81     public MessageElement getFaultCode() {
82         return faultCode;
83     }
84
85     public void setFaultCode(MessageElement faultCode) {
86         this.faultCode = faultCode;
87     }
88 }
89
Popular Tags