none
Calling a WSE web service from a WCF console application, works on 4.x but fails on 3.5 !! RRS feed

  • Question


  • Hello,

    We have a ASMX web service developped with the WSE extensions...  now we want to use this service in Sharepoint, I am not responsible for the Sharepoint part so I have done a Console application with VS2013 and Framework 4.5.1 and it works, here is a part of my config file :

    	<system.serviceModel>
    		<bindings>
    			<customBinding>
    				<binding name="BBinding" sendTimeout="00:05:00">
    					<textMessageEncoding messageVersion="Soap11WSAddressingAugust2004" />
    					<security authenticationMode="UserNameOverTransport" allowInsecureTransport="true" />
    					<httpTransport maxReceivedMessageSize="2147483647" />
    				</binding>
    			</customBinding>
    		</bindings>
    		<client>
    			<endpoint 
    				address="http://acme/myappws/myService.asmx" 
    				binding="customBinding" 
    				bindingConfiguration="BBinding"
    				contract="acme.myService" name="myService" />
    		</client>
    	</system.serviceModel>
    



    And part of the code :

    	myService.myClient ws = new myService.myClient();
    
    	ws.ClientCredentials.UserName.UserName = "test";
    	ws.ClientCredentials.UserName.Password = "test";
    
    
    	myService.atype[] dtypes = ws.FindAllTypes(DateTime.Now, true, false);
    

    The sharepoint team came back to me as they the client they have to build must in Framework 3.5 !!
    At first, I had this error: "Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message."

    So I have found on "http://social.msdn.microsoft.com/Forums/vstudio/en-US/f3707303-4f35-4079-ac0b-eba4717cada8/fault-exception-header-httpschemasxmlsoaporgws200408addressingaction-for-ultimate?forum=wcf" that I could use the message version that I use with 4.5.1 but it needed an HTTPS transport and I also found the solution for that.

    As "allowInsecureTransport="true"" doesn't exists on 3.5, is there another way of  calling this WSE web service from a 3.5 client ?

    Thanks for any help !
    Claude
    Monday, October 6, 2014 3:43 PM

Answers

  • Hi Claude Vernier,

    >>As "allowInsecureTransport="true"" doesn't exists on 3.5?

    Please try to check the following hotfixe to add the allowInsecureTransport attributes to WCF:

    http://support.microsoft.com/kb/976462 .

    The hotfix adds the AllowInsecureTransport property in the SecurityBindingElement class for the .NET Framework 3.5 Service Pack 1. The default value of this property is set to False. When the property is set to True, the mixed-mode secured message can be sent over an unsecured transport such as HTTP in Windows Communication Foundation (WCF) services. The property should be set to True only when the client and the service are in a trusted environment.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 7, 2014 6:56 AM
    Moderator

All replies

  • Hi Claude Vernier,

    >>As "allowInsecureTransport="true"" doesn't exists on 3.5?

    Please try to check the following hotfixe to add the allowInsecureTransport attributes to WCF:

    http://support.microsoft.com/kb/976462 .

    The hotfix adds the AllowInsecureTransport property in the SecurityBindingElement class for the .NET Framework 3.5 Service Pack 1. The default value of this property is set to False. When the property is set to True, the mixed-mode secured message can be sent over an unsecured transport such as HTTP in Windows Communication Foundation (WCF) services. The property should be set to True only when the client and the service are in a trusted environment.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 7, 2014 6:56 AM
    Moderator
  • Dear Amy, 

    Thank you for your answer.  The three version of that hotfix that I have found couldn't be installed on my developper virtual machine... it migth be that it was already there...

    I  believed that it was not working as intellisense was adding red underline beneath the 'allowInsecure...' but in fact, the error message was not about security but rather

    "The maximum nametable character count quota (16384) has been exceeded while reading XML data"

    Which I was able to fix with this config file :

    		<bindings>
    			<customBinding>
    				<binding name="BodiesBinding" sendTimeout="00:05:00">
    					<textMessageEncoding messageVersion="Soap11WSAddressingAugust2004">
    						<readerQuotas maxNameTableCharCount="2147483647" />
    					</textMessageEncoding>
    					<security authenticationMode="UserNameOverTransport" allowInsecureTransport="true" />
    					<httpTransport maxReceivedMessageSize="2147483647" />
    				</binding>
    			</customBinding>
    		</bindings>

    So now, everything works !!! Thanks a lot !! :)

    Claude

    I  believed that it was not working as intellisense was adding red underline b
    Tuesday, October 7, 2014 8:54 AM