Generating a WCF client proxy and application configuration files using the svcutil tool with WSDL
Instructions for generating WCF clients from WSDL if the metadata of the service is unavailable.
- Add the following namespace definitions and policy information:
<wsdl:definitions xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsp:Policy wsu:Id="CustomBinding_IWMQSampleContract_policy"> <wsp:ExtactlyOne> <wsp:All> <xms:xms xmlns:xms="http://sample.schemas.ibm.com/policy/xms" /> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> ... </wsdl:definitions>
- Modify the bindings section to refer to the new policy section and remove any transport definition from the underlying binding element:
<wsdl:definitions ...> <wsdl:binding ...> <wsp:PolicyReference URI="#CustomerBinding_IWMQSampleContract_policy" /> <[soap]:binding ... transport="" /> ... </wsdl:binding> </wsdl:definitions>
- Run svcutil from a command prompt, for example:
svcutil /language:C# /r: MQ_INSTALLATION_PATH\bin\IBM.XMS.WCF.dll /config:app.config MQ_INSTALLATION_PATH\src\samples\WMQAxis\default\service \soap.server.stockQuoteAxis_Wmq.wsdl