Skip to content

Commit

Permalink
no explicit wss
Browse files Browse the repository at this point in the history
Ref: http://stackoverflow.com/questions/5726127/adding-soap-implicit-headers-to-wsdl

From a conceptual point of view, WSDL is not supposed to define headers. WSDL is only for defining the functional aspects of a service, like operations, messages, binding and endpoints. Messages and bindings define how the payload of messages should be encoded and formatted.

The headers of SOAP messages however do not belong to the payload. They are typically used for configuring non-functional properties of a SOAP processor. Security is such a non-functional property. The functional aspect of the payload is not affected. It is only assured that the communication is secured and the WS tool stack, not the service implementation, should take care of that.

So the missing piece is now a standard that allows for attaching some non-functional requirements to WSDL services, so that code generators can automatically derive which headers need to be sent and/or understand in order to fulfill the non-functional property as desired -- without having to manually deal with header fields. This standard exists and is called WS-Policy. A policy contains typically a set of alternatives that expose a set of requirements that both, provider and consumer should be able to fulfill. When two services are supposed to interact with each other, both policies are taken and a so called "effective policy" is calculated. It defines the common non-functional requirements. Using this information, provider and consumer can configure themselves to add required headers, like the WS-Security headers. WS-SecurityPolicy also defines a set of policies that can be used. WS-PolicyAttachment defines how such policies can be attached to a WSDL.

There are code generators that can deal with WS-Policies, e.g. Metro or Axis2
  • Loading branch information
goetas committed Dec 20, 2016
1 parent 6bdda5e commit a50f41b
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions tests/Fixtures/test.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,8 @@
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
name="test" targetNamespace="http://www.example.org/test/">
<wsdl:types>
<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<xsd:include schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
</xsd:schema>

<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<xsd:include schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
</xsd:schema>

<xsd:schema targetNamespace="http://www.example.org/test/">
<xsd:element name="getSimple">
<xsd:complexType>
Expand Down Expand Up @@ -207,26 +198,8 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getWsseHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getWsseHeaderResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>

<wsdl:message name="Sec">
<wsdl:part element="wsse:Security" name="Security"/>
</wsdl:message>

<wsdl:message name="responseFault">
<wsdl:part name="responseFaultPart1" element="tns:aFault"></wsdl:part>
Expand Down Expand Up @@ -314,12 +287,6 @@
<wsdl:message name="noBothRequest"></wsdl:message>
<wsdl:message name="noBothResponse"></wsdl:message>

<wsdl:message name="getWsseHeaderRequest">
<wsdl:part name="parameters" element="tns:getWsseHeader"></wsdl:part>
</wsdl:message>
<wsdl:message name="getWsseHeaderResponse">
<wsdl:part name="parameters" element="tns:getWsseHeaderResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="test">
<wsdl:operation name="getSimple">
<wsdl:input message="tns:getSimpleRequest"/>
Expand Down Expand Up @@ -368,10 +335,6 @@
<wsdl:input message="tns:noBothRequest"></wsdl:input>
<wsdl:output message="tns:noBothResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWsseHeader">
<wsdl:input message="tns:getWsseHeaderRequest"></wsdl:input>
<wsdl:output message="tns:getWsseHeaderResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>

<wsdl:portType name="alternativeTPort">
Expand Down Expand Up @@ -518,17 +481,6 @@
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getWsseHeader">
<soap:operation
soapAction="http://www.example.org/test/getWsseHeader" />
<wsdl:input>
<soap:body use="literal" />
<soap:header use="literal" part="Security" message="tns:Sec"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:binding name="testSOAP12" type="tns:test">
Expand Down Expand Up @@ -649,18 +601,6 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="getWsseHeader">
<soap12:operation
soapAction="http://www.example.org/test/getWsseHeader" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header use="literal" part="Security" message="tns:Sec"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>

</wsdl:binding>

Expand Down

0 comments on commit a50f41b

Please sign in to comment.