# WebServiceBControl.jcx Sample

This topic inludes the source code for the WebServiceBControl.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/transport/clientCert/

## Sample Source Code

`001 package security.transport.clientCert; 002 003 /** 004 * @jc:location http-url="WebServiceB.jws" jms-url="WebServiceB.jws" 005 * @jc:wsdl file="#WebServiceBWsdl" 006 * @editor-info:link autogen-style="java" source="WebServiceB.jws" autogen="true" 007 */ 008 public interface WebServiceBControl extends com.bea.control.ControlExtension, com.bea.control.ServiceControl 009 { 010 public static class ContinueHeader 011 implements java.io.Serializable 012 { 013 public java.lang.String conversationID; 014 } 015 016 public static class CallbackHeader 017 implements java.io.Serializable 018 { 019 public java.lang.String conversationID; 020 } 021 022 public static class StartHeader 023 implements java.io.Serializable 024 { 025 public java.lang.String conversationID; 026 public java.lang.String callbackLocation; 027 } 028 029 030 public interface Callback extends com.bea.control.ServiceControl.Callback 031 { 032 /** 033 * @jc:conversation phase="finish" 034 */ 035 public void result (java.lang.String message); 036 037 } 038 039 /** 040 * @jc:conversation phase="start" 041 */ 042 public void requestCallback (java.lang.String caller); 043 044 static final long serialVersionUID = 1L; 045 } 046 047 /** @common:define name="WebServiceBWsdl" value:: 048 <?xml version="1.0" encoding="utf-8"?> 049 <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://openuri.org/bea/samples/workshop/clientcert/webserviceb" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://openuri.org/bea/samples/workshop/clientcert/webserviceb"> 050 <types> 051 <s:schema elementFormDefault="qualified" targetNamespace="http://openuri.org/bea/samples/workshop/clientcert/webserviceb" xmlns:s="http://www.w3.org/2001/XMLSchema"> 052 <s:element name="resultResponse"> 053 <s:complexType> 054 <s:sequence/> 055 </s:complexType> 056 </s:element> 057 <s:element name="result"> 058 <s:complexType> 059 <s:sequence> 060 <s:element name="message" type="s:string" minOccurs="0"/> 061 </s:sequence> 062 </s:complexType> 063 </s:element> 064 <s:element name="requestCallback"> 065 <s:complexType> 066 <s:sequence> 067 <s:element name="caller" type="s:string" minOccurs="0"/> 068 </s:sequence> 069 </s:complexType> 070 </s:element> 071 <s:element name="requestCallbackResponse"> 072 <s:complexType> 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="resultSoapIn"> 101 <part name="parameters" element="s0:resultResponse"/> 102 </message> 103 <message name="resultSoapOut"> 104 <part name="parameters" element="s0:result"/> 105 </message> 106 <message name="requestCallbackSoapIn"> 107 <part name="parameters" element="s0:requestCallback"/> 108 </message> 109 <message name="requestCallbackSoapOut"> 110 <part name="parameters" element="s0:requestCallbackResponse"/> 111 </message> 112 <message name="resultHttpGetIn"/> 113 <message name="resultHttpGetOut"> 114 <part name="message" type="s:string"/> 115 </message> 116 <message name="requestCallbackHttpGetIn"> 117 <part name="caller" type="s:string"/> 118 </message> 119 <message name="requestCallbackHttpGetOut"/> 120 <message name="resultHttpPostIn"/> 121 <message name="resultHttpPostOut"> 122 <part name="message" type="s:string"/> 123 </message> 124 <message name="requestCallbackHttpPostIn"> 125 <part name="caller" type="s:string"/> 126 </message> 127 <message name="requestCallbackHttpPostOut"/> 128 <message name="StartHeader_literal"> 129 <part name="StartHeader" element="conv:StartHeader"/> 130 </message> 131 <message name="CallbackHeader_literal"> 132 <part name="CallbackHeader" element="conv:CallbackHeader"/> 133 </message> 134 <portType name="WebServiceBSoap"> 135 <operation name="result"> 136 <output message="s0:resultSoapOut"/> 137 <input message="s0:resultSoapIn"/> 138 </operation> 139 <operation name="requestCallback"> 140 <input message="s0:requestCallbackSoapIn"/> 141 <output message="s0:requestCallbackSoapOut"/> 142 </operation> 143 </portType> 144 <portType name="WebServiceBHttpGet"> 145 <operation name="result"> 146 <output message="s0:resultHttpGetOut"/> 147 <input message="s0:resultHttpGetIn"/> 148 </operation> 149 <operation name="requestCallback"> 150 <input message="s0:requestCallbackHttpGetIn"/> 151 <output message="s0:requestCallbackHttpGetOut"/> 152 </operation> 153 </portType> 154 <portType name="WebServiceBHttpPost"> 155 <operation name="result"> 156 <output message="s0:resultHttpPostOut"/> 157 <input message="s0:resultHttpPostIn"/> 158 </operation> 159 <operation name="requestCallback"> 160 <input message="s0:requestCallbackHttpPostIn"/> 161 <output message="s0:requestCallbackHttpPostOut"/> 162 </operation> 163 </portType> 164 <binding name="WebServiceBSoap" type="s0:WebServiceBSoap"> 165 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> 166 <operation name="result"> 167 <soap:operation soapAction="http://openuri.org/bea/samples/workshop/clientcert/webserviceb/result" style="document"/> 168 <cw:transition phase="finish"/> 169 <input> 170 <soap:body use="literal"/> 171 </input> 172 <output> 173 <soap:body use="literal"/> 174 <soap:header wsdl:required="true" message="s0:CallbackHeader_literal" part="CallbackHeader" use="literal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> 175 </output> 176 </operation> 177 <operation name="requestCallback"> 178 <soap:operation soapAction="http://openuri.org/bea/samples/workshop/clientcert/webserviceb/requestCallback" style="document"/> 179 <cw:transition phase="start"/> 180 <input> 181 <soap:body use="literal"/> 182 <soap:header wsdl:required="true" message="s0:StartHeader_literal" part="StartHeader" use="literal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> 183 </input> 184 <output> 185 <soap:body use="literal"/> 186 </output> 187 </operation> 188 </binding> 189 <binding name="WebServiceBHttpGet" type="s0:WebServiceBHttpGet"> 190 <http:binding verb="GET"/> 191 <operation name="result"> 192 <http:operation location="/result"/> 193 <cw:transition phase="finish"/> 194 <input> 195 <mime:mimeXml part="Body"/> 196 </input> 197 <output> 198 <http:urlEncoded/> 199 </output> 200 </operation> 201 <operation name="requestCallback"> 202 <http:operation location="/requestCallback"/> 203 <cw:transition phase="start"/> 204 <input> 205 <http:urlEncoded/> 206 </input> 207 <output/> 208 </operation> 209 </binding> 210 <binding name="WebServiceBHttpPost" type="s0:WebServiceBHttpPost"> 211 <http:binding verb="POST"/> 212 <operation name="result"> 213 <http:operation location="/result"/> 214 <cw:transition phase="finish"/> 215 <input> 216 <mime:mimeXml part="Body"/> 217 </input> 218 <output> 219 <mime:content type="application/x-www-form-urlencoded"/> 220 </output> 221 </operation> 222 <operation name="requestCallback"> 223 <http:operation location="/requestCallback"/> 224 <cw:transition phase="start"/> 225 <input> 226 <mime:content type="application/x-www-form-urlencoded"/> 227 </input> 228 <output/> 229 </operation> 230 </binding> 231 <service name="WebServiceB"> 232 <port name="WebServiceBSoap" binding="s0:WebServiceBSoap"> 233 <soap:address location="http://localhost:7001/security/transport/clientCert/WebServiceB.jws"/> 234 </port> 235 <port name="WebServiceBHttpGet" binding="s0:WebServiceBHttpGet"> 236 <http:address location="http://localhost:7001/security/transport/clientCert/WebServiceB.jws"/> 237 </port> 238 <port name="WebServiceBHttpPost" binding="s0:WebServiceBHttpPost"> 239 <http:address location="http://localhost:7001/security/transport/clientCert/WebServiceB.jws"/> 240 </port> 241 </service> 242 </definitions> 243 * :: 244 */`