...
Generated service WSDL can be accessed by appending "?wsdl" to the service URL, as in:
Code Block |
---|
http://www.foo.com/someService?wsdl
|
...
The following is an example of enabling username/password authentication on a service:
Code Block |
---|
|
<component name="SecureService">
<implementation.java class="..."/>
<service name="SecureService">
<binding.ws uri="/authenticationService" requires="sca:clientAuthentication.message"/>
</service>
</component>
|
The above example will secure the web services endpoint with username/password authentication. During an invocation, Fabric3 will compare the username and password credentials against users configured through the security framework (see the security chapter for details on configuring users). It is also possible to perform authorization where only users with specific roles gain access to a service. To configure authorization, the @RolesAllowed intent attribute can be used on the SecureService implementation:
Code Block |
---|
|
public class SecureServiceImpl implements SecureService {
@RolesAllowed({"role1", "role2"})
public void call() {
//....
}
}
|
References are configured to pass username/password information using the <configuration> element:
Code Block |
---|
|
<binding.ws uri="https://www.foo.com/authenticationService" requires="sca:clientAuthentication.message">
<configuration>
<username>foo</username>
<password>bar</password>
</configuration>
</binding.ws>
|
...
Using X.509-based authentication is similar to configuring username/password authentication:
Code Block |
---|
|
<component name="SecureService">
<implementation.java class="..."/>
<service name="SecureService">
*<binding.ws uri="/authenticationService" requires="f3:clientAuthentication.X509"/>*
</service>
</component>
|
The above assumes a certificate store has been configured for Fabric3. For details on how to do this, see Chapter 8 on security. During an invocation, Fabric3 will match the certificate credential with one in the configured trust store.
References are configured to pass a certificate using the <configuration> element and the certificate alias:
Code Block |
---|
|
<binding.ws uri="https://www.foo.com/authenticationService" requires="sca:clientAuthentication.message">
<configuration>
<alias>certAlias</alias>
</configuration>
</binding.ws>
|
...
The following shows how to configure connection open and request timeouts:
Code Block |
---|
|
<binding.ws uri="...">
<configuration>
<connectTimeout>10000</connectTimeout>
<requestTimeout>10000</requestTimeout>
</configuration>
</binding.ws>
|
The number of retries when a service is unavailable can be configured using the retries attribute:
Code Block |
---|
|
<binding.ws uri="..." retries="1">
<configuration>
<connectTimeout>10000</connectTimeout>
<requestTimeout>10000</requestTimeout>
</configuration>
</binding.ws>
|
...
To dump HTTP traffic to the console, set the following variable when starting the Fabric3 JVM:
Code Block |
---|
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
|
To change the web service binding log level, configure the <web.services> element in systemConfig.xml:
Code Block |
---|
xml | xml |
<web.services>
<metro logging=".."/>
</web.services>
|