Generate non-duplex proxy code for a SOAP webservice

189 Views Asked by At

When I generate a web service proxy class by adding a service reference the code generator implments a proxy which is based on a DuplexClientBase class. This implementation requires a binding configuration that is duplex enabled. Since, when using duplex, only wsDualHttpBinding seems to work.

I would like to generate a class that has no duplex contract. Can I instruct Visual Studio or svcutil.exe to not generate duplex code? The webservice is SOAP based so I could not imagine why I actually would need duplex.

The web.config of the service is as following:

<system.serviceModel>
    <services>
      <service behaviorConfiguration="IncidentBehavior" name="omwWS.ServiceImplementation.Incident">
        <endpoint address="" binding="customBinding" bindingConfiguration="CustomBinding_IIncident"
          contract="omwWS.ServiceContracts.IncidentAccess" />
      </service>
    </services>
    <bindings>
      <customBinding>
        <binding name="CustomBinding_IIncident">
          <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004" />
          <httpsTransport authenticationScheme="Basic" maxReceivedMessageSize="52428800" maxBufferSize="52428800" />
        </binding>
      </customBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="IncidentBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
1

There are 1 best solutions below

1
On

The most easiest way is using Add Web Service reference instead of using Add Service Reference.

Because your service is a simple structured soap service, without any advanced scenario such as duplex

communication, you will not lose anything on client side.

In 'Add Service Reference' window, click on Advanced button, provide address and click add reference.

It will generate a client side for you based on .NET 2 technology

Let me know if any other information is needed.

Good luck