Skip to content

Commit a50f41b

Browse files
committed
no explicit wss
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
1 parent 6bdda5e commit a50f41b

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

tests/Fixtures/test.wsdl

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,8 @@
44
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
55
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
66
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
7-
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
87
name="test" targetNamespace="http://www.example.org/test/">
98
<wsdl:types>
10-
<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
11-
<xsd:include schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
12-
</xsd:schema>
13-
14-
<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
15-
<xsd:include schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
16-
</xsd:schema>
17-
189
<xsd:schema targetNamespace="http://www.example.org/test/">
1910
<xsd:element name="getSimple">
2011
<xsd:complexType>
@@ -207,26 +198,8 @@
207198
</xsd:sequence>
208199
</xsd:complexType>
209200
</xsd:element>
210-
<xsd:element name="getWsseHeader">
211-
<xsd:complexType>
212-
<xsd:sequence>
213-
<xsd:element name="in" type="xsd:string"></xsd:element>
214-
</xsd:sequence>
215-
</xsd:complexType>
216-
</xsd:element>
217-
<xsd:element name="getWsseHeaderResponse">
218-
<xsd:complexType>
219-
<xsd:sequence>
220-
<xsd:element name="out" type="xsd:string"></xsd:element>
221-
</xsd:sequence>
222-
</xsd:complexType>
223-
</xsd:element>
224201
</xsd:schema>
225202
</wsdl:types>
226-
227-
<wsdl:message name="Sec">
228-
<wsdl:part element="wsse:Security" name="Security"/>
229-
</wsdl:message>
230203

231204
<wsdl:message name="responseFault">
232205
<wsdl:part name="responseFaultPart1" element="tns:aFault"></wsdl:part>
@@ -314,12 +287,6 @@
314287
<wsdl:message name="noBothRequest"></wsdl:message>
315288
<wsdl:message name="noBothResponse"></wsdl:message>
316289

317-
<wsdl:message name="getWsseHeaderRequest">
318-
<wsdl:part name="parameters" element="tns:getWsseHeader"></wsdl:part>
319-
</wsdl:message>
320-
<wsdl:message name="getWsseHeaderResponse">
321-
<wsdl:part name="parameters" element="tns:getWsseHeaderResponse"></wsdl:part>
322-
</wsdl:message>
323290
<wsdl:portType name="test">
324291
<wsdl:operation name="getSimple">
325292
<wsdl:input message="tns:getSimpleRequest"/>
@@ -368,10 +335,6 @@
368335
<wsdl:input message="tns:noBothRequest"></wsdl:input>
369336
<wsdl:output message="tns:noBothResponse"></wsdl:output>
370337
</wsdl:operation>
371-
<wsdl:operation name="getWsseHeader">
372-
<wsdl:input message="tns:getWsseHeaderRequest"></wsdl:input>
373-
<wsdl:output message="tns:getWsseHeaderResponse"></wsdl:output>
374-
</wsdl:operation>
375338
</wsdl:portType>
376339

377340
<wsdl:portType name="alternativeTPort">
@@ -518,17 +481,6 @@
518481
<soap:body use="literal" />
519482
</wsdl:output>
520483
</wsdl:operation>
521-
<wsdl:operation name="getWsseHeader">
522-
<soap:operation
523-
soapAction="http://www.example.org/test/getWsseHeader" />
524-
<wsdl:input>
525-
<soap:body use="literal" />
526-
<soap:header use="literal" part="Security" message="tns:Sec"/>
527-
</wsdl:input>
528-
<wsdl:output>
529-
<soap:body use="literal" />
530-
</wsdl:output>
531-
</wsdl:operation>
532484
</wsdl:binding>
533485

534486
<wsdl:binding name="testSOAP12" type="tns:test">
@@ -649,18 +601,6 @@
649601
<soap12:body use="literal"/>
650602
</wsdl:output>
651603
</wsdl:operation>
652-
653-
<wsdl:operation name="getWsseHeader">
654-
<soap12:operation
655-
soapAction="http://www.example.org/test/getWsseHeader" />
656-
<wsdl:input>
657-
<soap12:body use="literal" />
658-
<soap12:header use="literal" part="Security" message="tns:Sec"/>
659-
</wsdl:input>
660-
<wsdl:output>
661-
<soap12:body use="literal" />
662-
</wsdl:output>
663-
</wsdl:operation>
664604

665605
</wsdl:binding>
666606

0 commit comments

Comments
 (0)