You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-ws-docs/src/docs/asciidoc/server.adoc
+34-9Lines changed: 34 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -633,14 +633,14 @@ public class EchoConfig {
633
633
----
634
634
====
635
635
636
-
To customize the `@EnableWs` configuration, you can implement `WsConfigurer`:
636
+
To customize the `@EnableWs` configuration, you can implement `WsConfigurer` and override individual methods:
637
637
638
638
====
639
639
[source,java]
640
640
----
641
641
@Configuration
642
642
@EnableWs
643
-
public class MyConfiguration implements WsConfigurer {
643
+
public class EchoConfig implements WsConfigurer {
644
644
645
645
@Override
646
646
public void addInterceptors(List<EndpointInterceptor> interceptors) {
@@ -652,7 +652,30 @@ public class MyConfiguration implements WsConfigurer {
652
652
argumentResolvers.add(new MyArgumentResolver());
653
653
}
654
654
655
-
// More overridden methods ...
655
+
}
656
+
----
657
+
====
658
+
659
+
If `WsConfigurer` does not expose some more advanced setting that needs to be configured, consider removing `@EnableWs` and extending directly from `WsConfigurationSupport` or `DelegatingWsConfiguration`.
660
+
661
+
====
662
+
[source,java]
663
+
----
664
+
@Configuration
665
+
public class EchoConfig extends WsConfigurationSupport {
666
+
667
+
@Override
668
+
public void addInterceptors(List<EndpointInterceptor> interceptors) {
669
+
interceptors.add(new MyInterceptor());
670
+
}
671
+
672
+
@Bean
673
+
@Override
674
+
public PayloadRootAnnotationMethodEndpointMapping payloadRootAnnotationMethodEndpointMapping() {
675
+
// Create or delegate to "super" to create and
676
+
// customize properties of PayloadRootAnnotationMethodEndpointMapping
677
+
}
678
+
656
679
}
657
680
----
658
681
====
@@ -670,7 +693,7 @@ If you want to use a different scope, such as prototype, see the {spring-framewo
670
693
Note that all abstract base classes provided in Spring-WS are thread safe, unless otherwise indicated in the class-level Javadoc.
671
694
672
695
[[server-atEndpoint-methods]]
673
-
=== `@Endpoint` handling methods
696
+
== `@Endpoint` handling methods
674
697
675
698
For an endpoint to actually handle incoming XML messages, it needs to have one or more handling methods.
676
699
Handling methods can take wide range of parameters and return types.
@@ -697,7 +720,7 @@ The `order` method takes an `Element` (annotated with `@RequestPayload`) as a pa
697
720
This means that the payload of the message is passed on this method as a DOM element.
698
721
The method has a `void` return type, indicating that no response message is sent.
699
722
700
-
==== Handling Method Parameters
723
+
=== Handling Method Parameters
701
724
702
725
The handling method typically has one or more parameters that refer to various parts of the incoming XML message.
703
726
Most commonly, the handling method has a single parameter that maps to the payload of the message, but it can also map to other parts of the request message, such as a SOAP header.
@@ -808,7 +831,7 @@ You can even extend this mechanism to support your own parameter types.
808
831
See the Javadoc of {spring-ws-api}/server/endpoint/adapter/DefaultMethodEndpointAdapter.html[`DefaultMethodEndpointAdapter`] and {spring-ws-api}/server/endpoint/adapter/method/MethodArgumentResolver.html[`MethodArgumentResolver`] to see how.
809
832
810
833
[[server-xpath-param]]
811
-
===== `@XPathParam`
834
+
==== `@XPathParam`
812
835
813
836
One parameter type needs some extra explanation: `@XPathParam`.
814
837
The idea here is that you annotate one or more method parameters with an XPath expression and that each such annotated parameter is bound to the evaluation of the expression.
@@ -860,7 +883,7 @@ By using the `@XPathParam`, you can bind to all the data types supported by XPat
860
883
861
884
In addition to this list, you can use any type that can be converted from a `String` by a Spring {spring-framework-docs}/core/validation/convert.html#core-convert-ConversionService-API[conversion service].
862
885
863
-
==== Handling method return types
886
+
=== Handling method return types
864
887
865
888
To send a response message, the handling needs to specify a return type.
866
889
If no response message is required, the method can declare a `void` return type.
@@ -942,8 +965,8 @@ The concept of configurable endpoint mappings that can optionally contain interc
942
965
A lot of supporting functionality can be built into custom `EndpointMapping` implementations.
943
966
For example, a custom endpoint mapping could choose an endpoint based not only on the contents of a message but also on a specific SOAP header (or, indeed, multiple SOAP headers).
944
967
945
-
Most endpoint mappings inherit from the `AbstractEndpointMapping`, which offers an '`interceptors`' property, which is the list of interceptors to use. `EndpointInterceptors` are discussed in <<server-endpoint-interceptor>>.
946
-
Additionally, there is the `defaultEndpoint`, which is the default endpoint to use when this endpoint mapping does not result in a matching endpoint.
968
+
Most endpoint mappings inherit from the `AbstractEndpointMapping`, which offers an '`interceptors`' property, which is the list of interceptors to use.
969
+
`EndpointInterceptors` are discussed in <<server-endpoint-interceptor>>.
947
970
948
971
As explained in <<server-endpoints>>, the `@Endpoint` style lets you handle multiple requests in one endpoint class.
949
972
This is the responsibility of the `MethodEndpointMapping`.
@@ -957,6 +980,8 @@ Whenever a message comes in with this qualified name for the payload root elemen
957
980
Alternatively, the `SoapActionAnnotationMethodEndpointMapping` uses the `@SoapAction` annotation to mark methods with a particular SOAP Action.
958
981
Whenever a message comes in with this `SOAPAction` header, the method is invoked.
959
982
983
+
`AbstractEndpointMapping` implementations provides a `defaultEndpoint` property that configures the endpoint to use when a configured mapping does not result in a matching endpoint.
0 commit comments