Each message sent from the client to the service contains in the header the name of the operation which has to be executed at the service side. For example, if the operation helloWorld has to be executed then the action-header of the message contains the name of the target operation.
The property message.Headers.Action would have in this case following value: ahttp://daenet.eu/TestSvc/helloWorld
If the client and the server are booth based on the WCF, you will never have to know that such property even exists. Unfortunately, if you interoperate with different technologies (i.e.: .NET/JAVA), this could become very important.
The exact value used on the action property can be manipulated either in the client’s proxy code or in the WSDL. The right way would be to specify the required value in the WSDL, then to build the proxy by using of SVCUTIL.EXE.
The required action-value can be specified in the WSDL as shown in the next WSDL snippet:
. . .
This means, that the operation with the name “helloWorld” will be called with the action header which contains value: “http://daenet.eu/TestSvc/helloWorld”.
More over, the same value will be used in the HTTP-action-header if HTTP binding used. WCF just ignores the HTTP header, but some WS-stacks use it as target action.
The appropriate proxy generated by SVCUTIL.EXE would define the operation “helloWorld” as follows:
helloWorldResponse1 helloWorld(helloWorldRequest1 request);
Unfortunately, there is one gap in this scenario. If you use the version of SVCUTIL delivered with CTP July 2006, all works fine. If some earlier version of SVCUTIL is used the WSDL attribute Action (see example above) will just be ignored. In this case you can directly manipulate the proxy file as shown in example above.
Jul 27 2006, 05:09 PM