locked
Create a Soap 11 client in .Net RRS feed

  • Question

  • I am getting error calling a WCF service using a .Net client. I can call the same service using SoapUI. The error is listed below

    {"The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.."}

    The binding for the service is listed below

             <customBinding>
                    <binding name="CustomBinding_IBroker">
                        <security defaultAlgorithmSuite="Basic128" authenticationMode="UserNameOverTransport"
                            requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true"
     messageSecurityVersion=

    "WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
                            <localClientSettings detectReplays="false" />
                            <localServiceSettings detectReplays="false" />
                        </security>
                        <textMessageEncoding />
                        <httpsTransport />
                    </binding>
                </customBinding>

    Is it possible to indicate on this setting that the intention is to use Soap 11 messaging rather than 12. 

    Thanks

    Monday, October 13, 2014 12:35 PM

All replies

  • Hi Sofia,

    Maybe this link can help you:

    http://blog.allanglen.com/2010/04/wcf-interoperability-with-soap-1-1-and-soap-1-2-clients

    Bye

    Alessandro


    Alessandro Graps

    Monday, October 20, 2014 12:56 PM
  • Hi Sofia,

    You can call wcf from REST and SOAP using below config settings.

    <?xml version="1.0"?>
    <configuration>
      <system.web>
        <compilation debug="true" targetFramework="4.0" />   
      </system.web>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="bBinding" receiveTimeout="00:03:00" sendTimeout="00:03:00">
              <security mode="Transport">
                <transport clientCredentialType="None"></transport>
              </security>
            </binding>
          </basicHttpBinding>
          <webHttpBinding>
            <!--<binding name="wBinding" crossDomainScriptAccessEnabled="true">-->
            <binding name="wBinding" receiveTimeout="00:03:00" sendTimeout="00:03:00">
             
              <security mode="Transport">
                <transport clientCredentialType="None"></transport>
              </security>
            </binding>
          </webHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="srvBehavior">
              <!--if https httpsGetEnabled must be true -->
              <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="ServiceAspNetAjaxBehavior">
              <enableWebScript/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
        <services>
          <service behaviorConfiguration="srvBehavior" name="your wcf service class name">
            <endpoint address="soap" binding="basicHttpBinding" bindingConfiguration="bBinding" contract="your wcf service interface name"/>
            <endpoint address="rest" binding="webHttpBinding" bindingConfiguration="wBinding" contract="your wcf service interface name"  behaviorConfiguration="ServiceAspNetAjaxBehavior"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    </configuration>
    


    If you find this post helpful then please Vote as Helpful and Mark As Answer. Thanks and Regards, Polat Aydın http://crmpolataydin.wordpress.com

    Monday, October 20, 2014 1:37 PM