Changing encryption Algorithm in WSE 3.0 - webservice-client

I am using a Java web services from a c# client.The web services is using WS-security.The request I am sending is using
Where as the server is expecting
When I tried changing it in the code I found that this property is a read-only property.
So how can I change this property?

Below is the actual code from my WSE 3.0 client to change the encryption algorithm.
X509SecurityTokenManager objCertTokenManager = (X509SecurityTokenManager)SecurityTokenManager.GetSecurityTokenManagerByTokenType(WSTrust.TokenTypes.X509v3);
objCertTokenManager.DefaultKeyAlgorithm = "RSA15";
objCertTokenManager.DefaultSessionKeyAlgorithm = "TripleDES";

Related

How to use wcf ServiceBehavior attribute for InstanceContextMode in Web API?

How can I use ServiceBehaviorAttribute in my Web API 2 project to create & recycle instance context object on every request? I tried to set it traditional way by configuring in web.config but didn't work. I think I may need to set custom attribute so any suggestion/thoughts are appreciated!
[ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerCall)]
I am new to Web API so not having much exposure on it.
The ServiceBehaviorAttribute is in the System.ServiceModel namespace and is used exclusively for WCF not for Web API. The following link seems to address your issue: Programmatically set InstanceContextMode

OAuth2 - Where did ClientSecret go?

I'm trying to write an ASP.NET application that uses the Google Calendar Service. To do so, I'm using the example shown here.
This is a TasksService application, but the methods should be pretty much the same.
It seems though, that this application uses an older version of DotNetOpenAuth, in which the ClientBase interface had a ClientSecret property. In the new version they removed this propery.
Where did this property go?
It is mandatory for the authorization process
The ClientSecret property was replaced with the ClientCredentialApplicator property (and constructor parameter). This gives you the freedom to express not only the secret, but how it should be communicated (via form POST parameter or HTTP Authorization header).

Why consuming WCF web service from ASP.NET 1.1 needs XmlSerializerFormat attribute in the ServiceContract

I am consuming a a WCF web service from APS.NET 1.1 and I read in everywhere that we need to
1 : Add XmlSerializerFormat attribute to the ServiceContract we want to consume.
2 : Use basicHttpBinding as Endpoint setting.
Why so?
-> Is it possible to set the POINT 1 condition someway in configuration file ?
-> When basicHttpBinding's default is XML serialization. Why do we need to explicitly declare the service contract as XmlSerializerFormat
?
Out of the box, I do not think WCF provides a way to override default serializer (i.e. DataContractSerializer). You however can create custom Service\Operation Behavior, define configuration element for custom Operation Behavior and use this to override serializer.
Default serializer of BasicHttpBinding is DataContractSerializer, NOT XmlSerializer. Both serializers work differently (although produce xml output). You can checkout the difference between behavior of these two serializers.

Flash Builder 4 Web Service Introspection for dynamic wsdl location

In Flex 3, introspecting a web service resulted in a constructor that allowed the location of the web service to change at runtime. It appears that the Web Service introspection tool now only allows the single WSDL URI that was specified in the WS Wizard. It this the case or am I just missing something?
Flex 3 introspected services would create a service class with the following constructor signatures:
private var service:MyWebService;
service= new MyWebService(null, wsdlLocation); // With parameters
or you could use:
service = new MyWebService(); //with no parameters
In Flex 4, it appears that you can only use:
service = new MyWebService();
So if you don't know the web server location until runtime, am I going to need to manually override the instrospected/generated _super_MyWebService.as class in order to get back the ability to point to different servers at runtime?
Anyone know why this has changed, or what the "new" way the Flash Builder 4 web service introspection tool uses for dynamic servers?
I found a solution to this question on the Adobe Forums.
The solution is to set the wsdl property once your service is created:
var service:MyWebService = new MyWebService();
service.wsdl = "location to the wsdl";
It should be noted that using the Flash Builder 4 web service introspection tool will automatically populate the wsdl location in the superclass. According to the post on Adobe Forums, it is necessary to remove the wsdl location in the superclass or the value will not get reset.

Setting Timeout value for Salesforce Web Service/API

The API for Salesforce is a web service, you set it up by downloading a WSDL file from Salesforce and adding the WSDL to your .NET project.
But I can't find anywhere to set the Timeout value.
Normally in a .NET Web Service there is a Timeout property for this (as described in this question), but I can't seem to find one in this case.
Having attached the WSDL to your .net App, you can configure the Timeout property on the proxy class like:
PartnerReference.SforceService partnerRef = new PartnerReference.SforceService();
partnerRef.Timeout = 30000;
partnerRef.UseDefaultCredentials = true;
partnerRef.Proxy = System.Net.WebRequest.DefaultWebProxy;
partnerRef.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
PartnerReference.LoginResult loginResult = partnerRef.login("Name", "Password");
I'm fairly sure that this will work for the Enterprise WSDL, too...

Resources