<defaultEndpoint> Element
Defines the default policy for all SOAP messages that are sent to or received by Web services affected by the policy file.
<policyDocument> Element
<mappings> Element
<defaultEndpoint>
<operation requestAction="SOAP action" />
<defaultOperation />
</defaultEndpoint>
Attributes and Elements
Attributes
None
Child Elements
Element | Description |
---|---|
Optional element. Specifies the WSDL operation, also known as a Web service method to which the policy is applied for the specified Web service. |
|
Optional element. Specifies the default policy for all operations not specifically mapped to a policy by the <operation> element. |
Parent Elements
Element | Description |
---|---|
Defines the mappings between policy assertions and endpoints. |
Text Value
A text value is required. The text value is the URL for the security token service.
Remarks
Use the <defaultEndpoint> element to define a policy that is applied to all Web services not specifically mapped to a policy by the <endpoint> Element element. If no <defaultEndpoint> element exists and a SOAP message is received with a <to> element that does not map to any of the <endpoint> elements, the SOAP message is rejected and a SOAP fault is returned to the sender.
Example
The following code example defines a policy assertion named encrypted-body-x509
that requires the encryption of the <Body> element by an X509SecurityToken and requires that SOAP messages sent to the http://www.cohowinery.com/Service1.asmx
endpoint adhere to the policy assertion. For all other SOAP messages, the message-age-20s
policy is applied.
Note
This code example is designed to demonstrate WSE features and is not intended for production use.
<?xml version="1.0" encoding="utf-8"?>
<policyDocument xmlns="https://schemas.microsoft.com/wse/2003/06/Policy">
<mappings>
<endpoint uri="http://www.cohowinery.com/Service1.asmx">
<defaultOperation>
<request policy="#encrypted-body-x509" />
<response policy="" />
<fault policy="" />
</defaultOperation>
</endpoint>
<defaultEndpoint>
<defaultOperation>
<request policy="#message-age-20s" />
<response policy="" />
<fault policy="" />
</defaultOperation>
</defaultEndpoint>
</mappings>
<policies xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wse="https://schemas.microsoft.com/wse/2003/06/Policy"
xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wssp="https://schemas.xmlsoap.org/ws/2002/12/secext"
xmlns:wsp="https://schemas.xmlsoap.org/ws/2002/12/policy"
xmlns:wssc="https://schemas.xmlsoap.org/ws/2004/04/sc"
xmlns:rp="https://schemas.xmlsoap.org/rp">
<!--This policy ensures that messages are 20 seconds old or newer.-->
<wsp:Policy wsu:Id="message-age-20s">
<wssp:MessageAge wsp:Usage="wsp:Required" Age="20" />
</wsp:Policy>
<!--This policy requires that the body be encrypted by an X509 security token.-->
<wsp:Policy wsu:Id="encrypted-body-x509">
<wssp:Confidentiality wsp:Usage="wsp:Required">
<wssp:KeyInfo>
<wssp:SecurityToken>
<wssp:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3</wssp:TokenType>
</wssp:SecurityToken>
</wssp:KeyInfo>
<wssp:MessageParts xmlns:rp="https://schemas.xmlsoap.org/rp" Dialect="https://schemas.xmlsoap.org/2002/12/wsse#part">wsp:Body()</wssp:MessageParts>
</wssp:Confidentiality>
</wsp:Policy>
</policies>
</policyDocument>
See Also
Reference
<mappings> Element
<operation> Element
<defaultOperation> Element
<endpoint> Element