KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > remote > soap > LZSOAPOperation


1 /* *****************************************************************************
2  * LZSOAPOperation.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.remote.soap;
11
12 public class LZSOAPOperation
13 {
14     /**
15      * Name of operation.
16      */

17     String JavaDoc mName;
18
19     /**
20      * Mangled name of operation.
21      */

22     String JavaDoc mMangledName;
23
24     /**
25      * From WSDL spec: For the HTTP protocol binding of SOAP, [soapAction] is
26      * value required (it has no default value).
27      */

28     String JavaDoc mSoapAction = null;
29
30     /**
31      * For document styles. See
32      * http://www-106.ibm.com/developerworks/webservices/library/ws-whichwsdl:
33      *
34      * Characteristics of document/literal wrapped pattern:
35      *
36      * - The input message has a single part
37      * - The part is an element
38      * - The element has the same name as the operation
39      * - The element's complex type has no attributes.
40      *
41      */

42     boolean mIsDocumentLiteralWrapped = false;
43
44     /**
45      * One of document or rpc.
46      */

47     String JavaDoc mStyle = "document";
48
49     // Let's not worry about header parts just yet
50
// LZSOAPMessage mInputHeader = new LZSOAPMessage();
51
// LZSOAPMessage mOutputHeader = new LZSOAPMessage();
52

53     LZSOAPMessage mInputMessage = null;
54     LZSOAPMessage mOutputMessage = null;
55
56
57     public LZSOAPOperation(String JavaDoc name) {
58         mName = name;
59         mMangledName = name;
60     }
61
62     public String JavaDoc getName() {
63         return mName;
64     }
65
66     public String JavaDoc getMangledName() {
67         return mMangledName;
68     }
69
70     public void setMangledName(String JavaDoc mangledName) {
71         mMangledName = mangledName;
72     }
73
74     public void setStyle(String JavaDoc style) {
75         mStyle = style;
76     }
77
78     public String JavaDoc getStyle() {
79         return mStyle;
80     }
81
82     public void setSoapAction(String JavaDoc soapAction) {
83         mSoapAction = soapAction;
84     }
85
86     public String JavaDoc getSoapAction() {
87         return mSoapAction;
88     }
89
90     public void setIsDocumentLiteralWrapped(boolean isDocumentLiteralWrapped) {
91         mIsDocumentLiteralWrapped = isDocumentLiteralWrapped;
92     }
93
94     public boolean isDocumentLiteralWrapped() {
95         return mIsDocumentLiteralWrapped;
96     }
97
98     public LZSOAPMessage getInputMessage() {
99         return mInputMessage;
100     }
101
102     public LZSOAPMessage getOutputMessage() {
103         return mOutputMessage;
104     }
105
106     public void setInputMessage(LZSOAPMessage inputMessage) {
107         mInputMessage = inputMessage;
108     }
109
110     public void setOutputMessage(LZSOAPMessage outputMessage) {
111         mOutputMessage = outputMessage;
112     }
113
114     public void toXML(StringBuffer JavaDoc sb) {
115         sb.append("<operation")
116             .append(" name=\"").append(mName).append("\"")
117             .append(" mangledName=\"").append(mMangledName).append("\"")
118             .append(" soapAction=\"").append(mSoapAction).append("\"")
119             .append(" style=\"").append(mStyle).append("\"")
120             .append(" is-document-literal-wrapped=\"").append(mIsDocumentLiteralWrapped).append("\"")
121             .append(">");
122         sb.append("<input>");
123         mInputMessage.toXML(sb);
124         sb.append("</input>");
125         sb.append("<output>");
126         mOutputMessage.toXML(sb);
127         sb.append("</output>");
128         sb.append("</operation>");
129     }
130 }
131
Popular Tags