SlowServiceControl.jcx Sample
This topic inludes the source code for the SlowServiceControl.jcx Sample.
Sample Location
This sample is located in the following directory in your WebLogic Workshop installation:
BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebServices/controlFactory/
Sample Source Code
001 package controlFactory;
002
003 /**
004 * <p>A dummy service that represents a back end service that takes an psuedo-random amount of time to do its work.</p>
005 * @jc:location http-url="SlowService.jws" jms-url="SlowService.jws"
006 * @jc:wsdl file="#SlowServiceWsdl"
007 * @editor-info:link autogen-style="java" source="SlowService.jws" autogen="true"
008 */
009 public interface SlowServiceControl extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
010 {
011 public static class StartHeader
012 implements java.io.Serializable
013 {
014 public java.lang.String conversationID;
015 public java.lang.String callbackLocation;
016 }
017
018 public static class ContinueHeader
019 implements java.io.Serializable
020 {
021 public java.lang.String conversationID;
022 }
023
024 public static class CallbackHeader
025 implements java.io.Serializable
026 {
027 public java.lang.String conversationID;
028 }
029
030
031 public interface Callback extends com.bea.control.ServiceControl.Callback
032 {
033 /**
034 * Callback that is sent to the client when this service is done doing its work.
035 * @jc:conversation phase="finish"
036 */
037 public void infoReady (java.lang.String name);
038
039 }
040
041 /**
042 * <p>The request from the client to do some work. After some amount of time, the infoReady callback will be sent to the client.</p>
043 * @jc:conversation phase="start"
044 */
045 public long requestInfo (java.lang.String name);
046
047 static final long serialVersionUID = 1L;
048 }
049
050 /** @common:define name="SlowServiceWsdl" value::
051 <?xml version="1.0" encoding="utf-8"?>
052 <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://workshop.bea.com/SlowService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://workshop.bea.com/SlowService">
053 <types>
054 <s:schema elementFormDefault="qualified" targetNamespace="http://workshop.bea.com/SlowService" xmlns:s="http://www.w3.org/2001/XMLSchema">
055 <s:element name="infoReadyResponse">
056 <s:complexType>
057 <s:sequence/>
058 </s:complexType>
059 </s:element>
060 <s:element name="infoReady">
061 <s:complexType>
062 <s:sequence>
063 <s:element name="name" type="s:string" minOccurs="0"/>
064 </s:sequence>
065 </s:complexType>
066 </s:element>
067 <s:element name="requestInfo">
068 <s:complexType>
069 <s:sequence>
070 <s:element name="name" type="s:string" minOccurs="0"/>
071 </s:sequence>
072 </s:complexType>
073 </s:element>
074 <s:element name="requestInfoResponse">
075 <s:complexType>
076 <s:sequence>
077 <s:element name="requestInfoResult" type="s:long"/>
078 </s:sequence>
079 </s:complexType>
080 </s:element>
081 <s:element name="long" type="s:long"/>
082 </s:schema>
083
084 <s:schema elementFormDefault="qualified" targetNamespace="http://www.openuri.org/2002/04/soap/conversation/">
085 <s:element name="StartHeader" type="conv:StartHeader"/>
086 <s:element name="ContinueHeader" type="conv:ContinueHeader"/>
087 <s:element name="CallbackHeader" type="conv:CallbackHeader"/>
088 <s:complexType name="StartHeader">
089 <s:sequence>
090 <s:element minOccurs="0" maxOccurs="1" name="conversationID" type="s:string"/>
091 <s:element minOccurs="0" maxOccurs="1" name="callbackLocation" type="s:string"/>
092 </s:sequence>
093 </s:complexType>
094 <s:complexType name="ContinueHeader">
095 <s:sequence>
096 <s:element minOccurs="1" maxOccurs="1" name="conversationID" type="s:string"/>
097 </s:sequence>
098 </s:complexType>
099 <s:complexType name="CallbackHeader">
100 <s:sequence>
101 <s:element minOccurs="1" maxOccurs="1" name="conversationID" type="s:string"/>
102 </s:sequence>
103 </s:complexType>
104 </s:schema>
105 </types>
106 <message name="infoReadySoapIn">
107 <part name="parameters" element="s0:infoReadyResponse"/>
108 </message>
109 <message name="infoReadySoapOut">
110 <part name="parameters" element="s0:infoReady"/>
111 </message>
112 <message name="requestInfoSoapIn">
113 <part name="parameters" element="s0:requestInfo"/>
114 </message>
115 <message name="requestInfoSoapOut">
116 <part name="parameters" element="s0:requestInfoResponse"/>
117 </message>
118 <message name="infoReadyHttpGetIn"/>
119 <message name="infoReadyHttpGetOut">
120 <part name="name" type="s:string"/>
121 </message>
122 <message name="requestInfoHttpGetIn">
123 <part name="name" type="s:string"/>
124 </message>
125 <message name="requestInfoHttpGetOut">
126 <part name="Body" element="s0:long"/>
127 </message>
128 <message name="infoReadyHttpPostIn"/>
129 <message name="infoReadyHttpPostOut">
130 <part name="name" type="s:string"/>
131 </message>
132 <message name="requestInfoHttpPostIn">
133 <part name="name" type="s:string"/>
134 </message>
135 <message name="requestInfoHttpPostOut">
136 <part name="Body" element="s0:long"/>
137 </message>
138 <message name="StartHeader_literal">
139 <part name="StartHeader" element="conv:StartHeader"/>
140 </message>
141 <message name="CallbackHeader_literal">
142 <part name="CallbackHeader" element="conv:CallbackHeader"/>
143 </message>
144 <portType name="SlowServiceSoap">
145 <operation name="infoReady">
146 <documentation>Callback that is sent to the client when this service is done doing its work.</documentation>
147 <output message="s0:infoReadySoapOut"/>
148 <input message="s0:infoReadySoapIn"/>
149 </operation>
150 <operation name="requestInfo">
151 <documentation><p>The request from the client to do some work. After some amount of time, the infoReady callback will be sent to the client.</p></documentation>
152 <input message="s0:requestInfoSoapIn"/>
153 <output message="s0:requestInfoSoapOut"/>
154 </operation>
155 </portType>
156 <portType name="SlowServiceHttpGet">
157 <operation name="infoReady">
158 <documentation>Callback that is sent to the client when this service is done doing its work.</documentation>
159 <output message="s0:infoReadyHttpGetOut"/>
160 <input message="s0:infoReadyHttpGetIn"/>
161 </operation>
162 <operation name="requestInfo">
163 <documentation><p>The request from the client to do some work. After some amount of time, the infoReady callback will be sent to the client.</p></documentation>
164 <input message="s0:requestInfoHttpGetIn"/>
165 <output message="s0:requestInfoHttpGetOut"/>
166 </operation>
167 </portType>
168 <portType name="SlowServiceHttpPost">
169 <operation name="infoReady">
170 <documentation>Callback that is sent to the client when this service is done doing its work.</documentation>
171 <output message="s0:infoReadyHttpPostOut"/>
172 <input message="s0:infoReadyHttpPostIn"/>
173 </operation>
174 <operation name="requestInfo">
175 <documentation><p>The request from the client to do some work. After some amount of time, the infoReady callback will be sent to the client.</p></documentation>
176 <input message="s0:requestInfoHttpPostIn"/>
177 <output message="s0:requestInfoHttpPostOut"/>
178 </operation>
179 </portType>
180 <binding name="SlowServiceSoap" type="s0:SlowServiceSoap">
181 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
182 <operation name="infoReady">
183 <soap:operation soapAction="http://workshop.bea.com/SlowService/infoReady" style="document"/>
184 <cw:transition phase="finish"/>
185 <input>
186 <soap:body use="literal"/>
187 </input>
188 <output>
189 <soap:body use="literal"/>
190 <soap:header wsdl:required="true" message="s0:CallbackHeader_literal" part="CallbackHeader" use="literal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
191 </output>
192 </operation>
193 <operation name="requestInfo">
194 <soap:operation soapAction="http://workshop.bea.com/SlowService/requestInfo" style="document"/>
195 <cw:transition phase="start"/>
196 <input>
197 <soap:body use="literal"/>
198 <soap:header wsdl:required="true" message="s0:StartHeader_literal" part="StartHeader" use="literal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
199 </input>
200 <output>
201 <soap:body use="literal"/>
202 </output>
203 </operation>
204 </binding>
205 <binding name="SlowServiceHttpGet" type="s0:SlowServiceHttpGet">
206 <http:binding verb="GET"/>
207 <operation name="infoReady">
208 <http:operation location="/infoReady"/>
209 <cw:transition phase="finish"/>
210 <input>
211 <mime:mimeXml part="Body"/>
212 </input>
213 <output>
214 <http:urlEncoded/>
215 </output>
216 </operation>
217 <operation name="requestInfo">
218 <http:operation location="/requestInfo"/>
219 <cw:transition phase="start"/>
220 <input>
221 <http:urlEncoded/>
222 </input>
223 <output>
224 <mime:mimeXml part="Body"/>
225 </output>
226 </operation>
227 </binding>
228 <binding name="SlowServiceHttpPost" type="s0:SlowServiceHttpPost">
229 <http:binding verb="POST"/>
230 <operation name="infoReady">
231 <http:operation location="/infoReady"/>
232 <cw:transition phase="finish"/>
233 <input>
234 <mime:mimeXml part="Body"/>
235 </input>
236 <output>
237 <mime:content type="application/x-www-form-urlencoded"/>
238 </output>
239 </operation>
240 <operation name="requestInfo">
241 <http:operation location="/requestInfo"/>
242 <cw:transition phase="start"/>
243 <input>
244 <mime:content type="application/x-www-form-urlencoded"/>
245 </input>
246 <output>
247 <mime:mimeXml part="Body"/>
248 </output>
249 </operation>
250 </binding>
251 <service name="SlowService">
252 <documentation><p>A dummy service that represents a back end service that takes an psuedo-random amount of time to do its work.</p></documentation>
253 <port name="SlowServiceSoap" binding="s0:SlowServiceSoap">
254 <soap:address location="http://localhost:7001/controlFactory/SlowService.jws"/>
255 </port>
256 <port name="SlowServiceHttpGet" binding="s0:SlowServiceHttpGet">
257 <http:address location="http://localhost:7001/controlFactory/SlowService.jws"/>
258 </port>
259 <port name="SlowServiceHttpPost" binding="s0:SlowServiceHttpPost">
260 <http:address location="http://localhost:7001/controlFactory/SlowService.jws"/>
261 </port>
262 </service>
263 </definitions>
264 * ::
265 */
|