TargetControl.jcx Sample

This topic inludes the source code for the TargetControl.jcx Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebServices/security/wsse/callback/client/

Sample Source Code


001 package security.wsse.callback.client;
002 
003 /**
004  * @jc:location http-url="http://localhost:7001/WebServices/security/wsse/callback/target/Target.jws"
005  * @jc:wsdl file="#TargetWsdl"
006  * @jc:ws-security-service file="TargetControlPolicy.wsse"
007  * @jc:ws-security-callback file="TargetControlPolicy.wsse"
008  */
009 public interface TargetControl 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          * @jc:conversation phase="finish"
035          */
036         public void callback (java.lang.String message);
037 
038     }
039 
040     /**
041      * @jc:conversation phase="start"
042      */
043     public void hello ();
044 
045     static final long serialVersionUID = 1L;
046 }
047 
048 /** @common:define name="TargetWsdl" value::
049     <?xml version="1.0" encoding="utf-8"?>
050     <!-- @editor-info:link autogen="true" source="Target.jws" -->
051     <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/Target" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://workshop.bea.com/Target">
052       <types>
053         <s:schema elementFormDefault="qualified" targetNamespace="http://workshop.bea.com/Target" xmlns:s="http://www.w3.org/2001/XMLSchema">
054           <s:element name="hello">
055             <s:complexType>
056               <s:sequence/>
057             </s:complexType>
058           </s:element>
059           <s:element name="helloResponse">
060             <s:complexType>
061               <s:sequence/>
062             </s:complexType>
063           </s:element>
064           <s:element name="callbackResponse">
065             <s:complexType>
066               <s:sequence/>
067             </s:complexType>
068           </s:element>
069           <s:element name="callback">
070             <s:complexType>
071               <s:sequence>
072                 <s:element name="message" type="s:string" minOccurs="0"/>
073               </s:sequence>
074             </s:complexType>
075           </s:element>
076         </s:schema>
077     
078         <s:schema elementFormDefault="qualified" targetNamespace="http://www.openuri.org/2002/04/soap/conversation/">
079           <s:element name="StartHeader" type="conv:StartHeader"/>
080           <s:element name="ContinueHeader" type="conv:ContinueHeader"/>
081           <s:element name="CallbackHeader" type="conv:CallbackHeader"/>
082           <s:complexType name="StartHeader">
083             <s:sequence>
084               <s:element minOccurs="0" maxOccurs="1" name="conversationID" type="s:string"/>
085               <s:element minOccurs="0" maxOccurs="1" name="callbackLocation" type="s:string"/>
086             </s:sequence>
087           </s:complexType>
088           <s:complexType name="ContinueHeader">
089             <s:sequence>
090               <s:element minOccurs="1" maxOccurs="1" name="conversationID" type="s:string"/>
091             </s:sequence>
092           </s:complexType>
093           <s:complexType name="CallbackHeader">
094             <s:sequence>
095               <s:element minOccurs="1" maxOccurs="1" name="conversationID" type="s:string"/>
096             </s:sequence>
097           </s:complexType>
098         </s:schema>
099       </types>
100       <message name="helloSoapIn">
101         <part name="parameters" element="s0:hello"/>
102       </message>
103       <message name="helloSoapOut">
104         <part name="parameters" element="s0:helloResponse"/>
105       </message>
106       <message name="callbackSoapIn">
107         <part name="parameters" element="s0:callbackResponse"/>
108       </message>
109       <message name="callbackSoapOut">
110         <part name="parameters" element="s0:callback"/>
111       </message>
112       <message name="helloHttpGetIn"/>
113       <message name="helloHttpGetOut"/>
114       <message name="callbackHttpGetIn"/>
115       <message name="callbackHttpGetOut">
116         <part name="message" type="s:string"/>
117       </message>
118       <message name="helloHttpPostIn"/>
119       <message name="helloHttpPostOut"/>
120       <message name="callbackHttpPostIn"/>
121       <message name="callbackHttpPostOut">
122         <part name="message" type="s:string"/>
123       </message>
124       <message name="StartHeader_literal">
125         <part name="StartHeader" element="conv:StartHeader"/>
126       </message>
127       <message name="CallbackHeader_literal">
128         <part name="CallbackHeader" element="conv:CallbackHeader"/>
129       </message>
130       <portType name="TargetSoap">
131         <operation name="hello">
132           <input message="s0:helloSoapIn"/>
133           <output message="s0:helloSoapOut"/>
134         </operation>
135         <operation name="callback">
136           <output message="s0:callbackSoapOut"/>
137           <input message="s0:callbackSoapIn"/>
138         </operation>
139       </portType>
140       <portType name="TargetHttpGet">
141         <operation name="hello">
142           <input message="s0:helloHttpGetIn"/>
143           <output message="s0:helloHttpGetOut"/>
144         </operation>
145         <operation name="callback">
146           <output message="s0:callbackHttpGetOut"/>
147           <input message="s0:callbackHttpGetIn"/>
148         </operation>
149       </portType>
150       <portType name="TargetHttpPost">
151         <operation name="hello">
152           <input message="s0:helloHttpPostIn"/>
153           <output message="s0:helloHttpPostOut"/>
154         </operation>
155         <operation name="callback">
156           <output message="s0:callbackHttpPostOut"/>
157           <input message="s0:callbackHttpPostIn"/>
158         </operation>
159       </portType>
160       <binding name="TargetSoap" type="s0:TargetSoap">
161         <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
162         <operation name="hello">
163           <soap:operation soapAction="http://workshop.bea.com/Target/hello" style="document"/>
164           <cw:transition phase="start"/>
165           <input>
166             <soap:body use="literal"/>
167             <soap:header wsdl:required="true" message="s0:StartHeader_literal" part="StartHeader" use="literal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
168           </input>
169           <output>
170             <soap:body use="literal"/>
171           </output>
172         </operation>
173         <operation name="callback">
174           <soap:operation soapAction="http://workshop.bea.com/Target/callback" style="document"/>
175           <cw:transition phase="finish"/>
176           <input>
177             <soap:body use="literal"/>
178           </input>
179           <output>
180             <soap:body use="literal"/>
181             <soap:header wsdl:required="true" message="s0:CallbackHeader_literal" part="CallbackHeader" use="literal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
182           </output>
183         </operation>
184       </binding>
185       <binding name="TargetHttpGet" type="s0:TargetHttpGet">
186         <http:binding verb="GET"/>
187         <operation name="hello">
188           <http:operation location="/hello"/>
189           <cw:transition phase="start"/>
190           <input>
191             <http:urlEncoded/>
192           </input>
193           <output/>
194         </operation>
195         <operation name="callback">
196           <http:operation location="/callback"/>
197           <cw:transition phase="finish"/>
198           <input>
199             <mime:mimeXml part="Body"/>
200           </input>
201           <output>
202             <http:urlEncoded/>
203           </output>
204         </operation>
205       </binding>
206       <binding name="TargetHttpPost" type="s0:TargetHttpPost">
207         <http:binding verb="POST"/>
208         <operation name="hello">
209           <http:operation location="/hello"/>
210           <cw:transition phase="start"/>
211           <input>
212             <mime:content type="application/x-www-form-urlencoded"/>
213           </input>
214           <output/>
215         </operation>
216         <operation name="callback">
217           <http:operation location="/callback"/>
218           <cw:transition phase="finish"/>
219           <input>
220             <mime:mimeXml part="Body"/>
221           </input>
222           <output>
223             <mime:content type="application/x-www-form-urlencoded"/>
224           </output>
225         </operation>
226       </binding>
227       <service name="Target">
228         <port name="TargetSoap" binding="s0:TargetSoap">
229           <soap:address location="http://localhost:7001/WebServices/security/wsse/callback/target/Target.jws"/>
230         </port>
231         <port name="TargetHttpGet" binding="s0:TargetHttpGet">
232           <http:address location="http://localhost:7001/WebServices/security/wsse/callback/target/Target.jws"/>
233         </port>
234         <port name="TargetHttpPost" binding="s0:TargetHttpPost">
235           <http:address location="http://localhost:7001/WebServices/security/wsse/callback/target/Target.jws"/>
236         </port>
237       </service>
238     </definitions>
239  * ::
240  */