WCF interoperability and WS Addressing

Damir Dobric Posts

Next talks:

 

Damir@Phone    

Follow me on Twitter: #ddobric



 

 

Archives

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:

 

<operation name="helloWorld">

 

. . .

 

<input

      message="tns:helloWorldReq"

      wsaw:Action=http://daenet.eu/TestSvc/helloWorld"/>

 

<output

      message="tns:helloWorldRes"

      wsaw:Action=http://daenet.eu/TestSvc/helloWorld"/>

</operation>

 

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:

 

 

[System.ServiceModel.OperationContractAttribute

(Action="http://daenet.eu/TestSvc/helloWorld", ReplyAction="http://daenet.eu/TestSvc/helloWorld")]

[System.ServiceModel.XmlSerializerFormatAttribute()]

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.


Posted Jul 27 2006, 05:09 PM by Damir Dobric
Filed under:

Comments

Damir Dobric Posts wrote Custom Channel and Message Delivering
on 04-04-2007 1:04

By implementing of the custom channel or by manipulating of the message in message inspectors (custom

developers.de is a .Net Community Blog powered by daenet GmbH.