Sustainsys.Saml2 not setting same site = none - sustainsys-saml2

We are using the v2.4 sustainsys.saml2 library and can't get the software to set the same site = none flag required by chrome 80. We get an error in the event viewer (reproduced below)
We are using .net V4.7.2 , windows server 2012 r2 and IIS. Our IdP has not yet implemented their fix for this issue. Could this be related?
Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 2/7/2020 9:43:02 AM
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: WSATPWEB02
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/7/2020 9:43:02 AM
Event time (UTC): 2/7/2020 4:43:02 PM
Event ID: 5319961cdc244a7fb390e1d5d01d9014
Event sequence: 21
Event occurrence: 3
Event detail code: 0
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at Sustainsys.Saml2.SameSiteHelper.DisallowsSameSiteNone(String userAgent)
at Sustainsys.Saml2.SameSiteHelper.EmitSameSiteNone(String userAgent)
at Sustainsys.Saml2.Configuration.Saml2Notifications.<>c.<.ctor>b__64_3(String userAgent)
at Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: https://testportal.myatphub.ca:443/Saml2/SignIn?ReturnUrl=/Authservices
Request path: /Saml2/SignIn
User host address: 10.254.9.72
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DefaultAppPool
Thread information:
Thread ID: 53
Thread account name: IIS APPPOOL\DefaultAppPool
Is impersonating: False
Stack trace: at Sustainsys.Saml2.SameSiteHelper.DisallowsSameSiteNone(String userAgent)
at Sustainsys.Saml2.SameSiteHelper.EmitSameSiteNone(String userAgent)
at Sustainsys.Saml2.Configuration.Saml2Notifications.<>c.<.ctor>b__64_3(String userAgent)
at Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="32768">1309</EventID>
<Level>3</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2020-02-07T16:43:02.000000000Z" />
<EventRecordID>101086</EventRecordID>
<Channel>Application</Channel>
<Computer>WSATPWEB02</Computer>
<Security />
</System>
<EventData>
<Data>3005</Data>
<Data>An unhandled exception has occurred.</Data>
<Data>2/7/2020 9:43:02 AM</Data>
<Data>2/7/2020 4:43:02 PM</Data>
<Data>5319961cdc244a7fb390e1d5d01d9014</Data>
<Data>21</Data>
<Data>3</Data>
<Data>0</Data>
<Data>/LM/W3SVC/1/ROOT-2-132255671020333604</Data>
<Data>Full</Data>
<Data>/</Data>
<Data>C:\inetpub\wwwroot\</Data>
<Data>WSATPWEB02</Data>
<Data>
</Data>
<Data>1864</Data>
<Data>w3wp.exe</Data>
<Data>IIS APPPOOL\DefaultAppPool</Data>
<Data>NullReferenceException</Data>
<Data>Object reference not set to an instance of an object.
at Sustainsys.Saml2.SameSiteHelper.DisallowsSameSiteNone(String userAgent)
at Sustainsys.Saml2.SameSiteHelper.EmitSameSiteNone(String userAgent)
at Sustainsys.Saml2.Configuration.Saml2Notifications.<>c.<.ctor>b__64_3(String userAgent)
at Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
</Data>
<Data>https://testportal.myatphub.ca:443/Saml2/SignIn?ReturnUrl=/Authservices</Data>
<Data>/Saml2/SignIn</Data>
<Data>10.254.9.72</Data>
<Data>
</Data>
<Data>False</Data>
<Data>
</Data>
<Data>IIS APPPOOL\DefaultAppPool</Data>
<Data>53</Data>
<Data>IIS APPPOOL\DefaultAppPool</Data>
<Data>False</Data>
<Data> at Sustainsys.Saml2.SameSiteHelper.DisallowsSameSiteNone(String userAgent)
at Sustainsys.Saml2.SameSiteHelper.EmitSameSiteNone(String userAgent)
at Sustainsys.Saml2.Configuration.Saml2Notifications.<>c.<.ctor>b__64_3(String userAgent)
at Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
</Data>
</EventData>
</Event>

That looks like a bug in the library, but you can work around it in your code.
The problem is in the default implementation of the EmitSameSiteNone notification. Could you please hook up your own implementation and see if that lets you troubleshoot? Is there a user agent string present in the request headers?

Related

" Message: Security error." While Requesting a Https Uri using WebClient OR HttpWebRequest using SilverLight Client

My Silverlight Client and REST Web Server(Implented using ASP.NET Handlers) both are on same domain.
Both HTTP and HTTPS protocol bindings are configured in IIS 7.0
When Request a URI using HTTPS , i Get Error " Message: "Security error."
But Same URI works just fine on HTTP request without any error
private void btnLoginWebRequest_Click(object sender, RoutedEventArgs e)
{
bool httpResult = WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
bool httpsResult = WebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);
this.Dispatcher.BeginInvoke(()=>
{
WebClient webClient = new WebClient();
webClient.Headers["CustomHeader"] = String.Format("myHeaders={0}", "Value");
webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(webClient_OpenReadCompleted);
webClient.OpenReadAsync(new Uri(#"https://xxx.xx.xxx.xxx/MyRESTApi/UserGroups"));
});
}
void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Error == null)
{
}
}
I Get a Error and e.Error contains the following Error information
{System.Security.SecurityException: Security error.
at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
at System.Net.WebClient.OpenReadAsyncCallback(IAsyncResult result)}
[System.Security.SecurityException]: {System.Security.SecurityException: Security error.
at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
at System.Net.WebClient.OpenReadAsyncCallback(IAsyncResult result)}
Data: {System.Collections.ListDictionaryInternal}
InnerException: null
Message: "Security error."
StackTrace: " at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)\r\n at System.Net.WebClient.OpenReadAsyncCallback(IAsyncResult result)"
crossdomain.xml is as follows :-
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" secure="true"/>
<allow-http-request-headers-from domain="*" headers="*" secure="true"/>
</cross-domain-policy>
clientaccesspolicy.xml is as follows :-
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="https://"/>
<domain uri="http://"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
I Have seen many threads related to similar error on stack overflow but not able to resolve this issue by any of the solutions provided in those threads. Am i missing something?

MVC3 Web Project Error: "An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128"

I published my MVC3 web project to Azure. When I tried to authorize with fb, I get an error below.
Additional info:
callbackUrl = http://site.azurewebsites.net/Facebook/AddSocialAccount
аuthenticateUrl = https://graph.facebook.com/oauth/authorize?client_id=*&response_type=code&redirect_uri=http%3A%2F%2Fsite.azurewebsites.net%2FFacebook%2FAddSocialAccount&scope=publish_stream%2Cemail%2Cuser_birthday
so the app authorizes on fb, goes to AddSocialAccount action and fails int the string:
var profile = this.Provider.GetUserProfile(code);
where goes to:
protected override Task<AccessGrant> PostForAccessGrantAsync(string accessTokenUrl, NameValueCollection request)
{
return this.RestTemplate.PostForObjectAsync<NameValueCollection>(accessTokenUrl, request)
.ContinueWith<AccessGrant>(task =>
{
string expires = task.Result["expires"];
return new AccessGrant(task.Result["access_token"], null, null, expires != null ? new Nullable<int>(Int32.Parse(expires)) : null);
});
}
and string with error is
string expires = task.Result["expires"];
Error:
Server Error in '/' Application.
enter code here
An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x271d): An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128]
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) +6462061
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +271
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) +2233126
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) +14
Spring.Http.Client.WebClientHttpRequest.ExecuteRequestCallback(IAsyncResult result) in f:\bamboo-home\xml-data\build-dir\SPRNETREST-RELEASE-JOB1\src\Spring.Rest\Http\Client\WebClientHttpRequest.cs:246
[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3548265
System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) +73
System.Threading.Tasks.Task`1.get_Result() +10486829
Project.Social.Facebook.Api.Impl.FacebookOAuth2Template.<PostForAccessGrantAsync>b__0(Task`1 task) in D:\Code\Poll\Project.Social\Facebook\Api\Impl\FacebookOAuth2Template.cs:23
System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() +81
System.Threading.Tasks.Task.Execute() +49
[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3548265
System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) +73
System.Threading.Tasks.Task`1.get_Result() +10486829
Project.Social.Base.OAuth2SocialProvider`4.SetAccessToken(String code) in D:\Code\Poll\Project.Social\Base\OAuth2SocialProvider.cs:49
Project.Social.Base.OAuth2SocialProvider`4.GetServiceClient(String oauth_verifier) in D:\Code\Poll\Project.Social\Base\OAuth2SocialProvider.cs:66
Project.Social.Facebook.FacebookProvider.GetUserProfile(String oauth_verifier) in D:\Code\Poll\Project.Social\Facebook\FacebookProvider.cs:26 Project.Areas.FrontEnd.Controllers.ControllersBase.OAuthControllerBase`3.AddSocialAccount(String code, String oauth_verifier) in D:\Code\Poll\Project\Areas\FrontEnd\Controllers\ControllersBase\OAuthControllerBase.cs:112
lambda_method(Closure , ControllerBase , Object[] ) +147
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +214
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +106
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
When I use local computer with connectionString of Azure I don't get this error(I change the domain and url on fb).
Thanks for any ideas!
I fixed this problem. There was the default proxy in my web.config.
<system.net>
<defaultProxy>
<proxy usesystemdefault="True" proxyaddress="http://10.10.0.1:3128" bypassonlocal="True" />
</defaultProxy>
I removed it. And authorization works correct.

Magento API error --- SoapHeaderException: Procedure 'login' not present

I am lost. I do not even know where to begin. This is the error I am getting:
Procedure 'login' not present
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapHeaderException: Procedure 'login' not present
Source Error:
Line 375: service.Url = account.APIURL;
Line 376:
Line 377: string sessionId = service.login(account.APIUser, account.APIPassword);
Line 378:
Line 379: var orders = service.salesOrderList(sessionId, InitialiseSOAPOrderCriteria(account.TriggerOrderStatus));
Source File: c:\inetpub\wwwroot\UAT.SFSystem\Settings\ChannelHeader.ascx.cs Line: 377
Stack Trace:
[SoapHeaderException: Procedure 'login' not present]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1772421
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +345
Adapters.MagentoSOAP.MagentoSOAP.MagentoService.login(String username, String apiKey) in C:\Work\WebCatch\SF\StoreFeeder\Middlewares\SFMWMagento\Adapters.MagentoSOAP\Web References\MagentoSOAP\Reference.cs:663
Settings_ChannelHeader.magentoTestConnection(String channelGuid) in c:\inetpub\wwwroot\UAT.SFSystem\Settings\ChannelHeader.ascx.cs:377
Settings_ChannelHeader.btnTestConnection_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\UAT.SFSystem\Settings\ChannelHeader.ascx.cs:154
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
I was getting the same error while using the v2 magento api, but problem resolved when I switched back to v1 soap api of magento

Invoking a WCF method that takes a List of objects. Consumed via an iPhone application

I have a WCF service that's consumed via an iPhone application. All other methods that accept string parameters or single objects are working fine, however when I invoke a method that takes a "List<CustomObjectClass> ssf".
I am passing an NSMutableArray of CustomObjectClass's to this method and I'm getting the following error:
Any ideas?
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode><faultstring xml:lang="en-AU">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:ssf. The InnerException message was 'Error in line 2 position 6. Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. '. Please see InnerException for more details.</faultstring><detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Error in line 2 position 6. Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. </Message><StackTrace> at ReadArrayOfScanShareFriendFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract )
at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)</StackTrace><Type>System.Runtime.Serialization.SerializationException</Type></InnerException><Message>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:ssf. The InnerException message was 'Error in line 2 position 6. Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. '. Please see InnerException for more details.</Message><StackTrace> at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type></ExceptionDetail></detail></s:Fault></s:Body></s:Envelope>
It looks like the SOAP message that was sent from iPhone application is not in format expected by the WCF service. If that's the case, you will probably have to take more control over serialization of NSMutableArray of CustomObjectClasses when passing the array to the method.
In order to check whether that is the issue, you could implement and configure WCF message inspector that would write the SOAP request message into a file and then review the file to check whether it looks like following SOAP message:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://tempuri.org/IService/SendData</a:Action>
<a:MessageID>urn:uuid:8a582916-1b9a-47f8-8fb1-c9ff18420391</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">net.tcp://localhost:13031/Service</a:To>
</s:Header>
<s:Body>
<SendData xmlns="http://tempuri.org/">
<ssf xmlns:b="http://schemas.datacontract.org/2004/07/Common"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<!-- Zero or more CustomObjectClass elements-->
<b:CustomObjectClass>
<!-- Zero or more elements for CustomObjectClass properties -->
</b:CustomObjectClass>
</ssf>
</SendData>
</s:Body>
</s:Envelope>
Implement WCF message inspector:
Implement WCF message inspector(IDispatchMessageInspector).
Implement endpoint behavior (IEndpointBehavior).
Implement custom behavior extension element (BehaviorExtensionElement).
WCF message inspector:
public class FileOutputMessageInspector : IDispatchMessageInspector
{
public object AfterReceiveRequest( ref Message request, IClientChannel channel,
InstanceContext instanceContext )
{
string path = Path.Combine(
AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
Guid.NewGuid().ToString() + ".xml"
);
File.WriteAllText( path, request.ToString() );
return null;
}
public void BeforeSendReply( ref Message reply, object correlationState )
{ }
}
Endpoint behavior:
public class FileOutputBehavior : IEndpointBehavior
{
public void AddBindingParameters( ServiceEndpoint endpoint,
BindingParameterCollection bindingParameters )
{ }
public void ApplyClientBehavior( ServiceEndpoint endpoint,
ClientRuntime clientRuntime )
{
throw new ApplicationException( "Behavior is not supported on client side." );
}
public void ApplyDispatchBehavior( ServiceEndpoint endpoint,
EndpointDispatcher endpointDispatcher )
{
FileOutputMessageInspector inspector = new FileOutputMessageInspector();
endpointDispatcher.DispatchRuntime.MessageInspectors.Add( inspector );
}
public void Validate( ServiceEndpoint endpoint )
{ }
}
Behavior extension element:
public class FileOutputElement : BehaviorExtensionElement
{
public override Type BehaviorType
{
get { return typeof( FileOutputBehavior ); }
}
protected override object CreateBehavior()
{
return new FileOutputBehavior();
}
}
Configure WCF message inspector:
Declare new behavior extension (Make sure that the correct full type name is used in type attribute).
Use the declared behavior extension in an endpoint behavior.
Reference the endpoint behavior.
Use following configuration as reference:
<system.serviceModel>
<services>
<service name="Server.Service">
<endpoint address=""
binding="netTcpBinding" bindingConfiguration="TCP"
contract="Common.IService"
behaviorConfiguration="RequestMessageToFile"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:13031/Service"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="TCP">
<security mode="None"/>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="RequestMessageToFile">
<requestFileOutput />
</behavior>
</endpointBehaviors>
</behaviors>
<extensions>
<behaviorExtensions>
<add name="requestFileOutput"
type="Common.FileOutputElement, Common"/>
</behaviorExtensions>
</extensions>
</system.serviceModel>

RPXLib.dll throwing the exception The remote server returned an error: (500) Internal Server Error

I am trying to build the site login facility as single sign on. some how I come across to the site Janrain where I found the API's to do so. also I am trying this in my asp.net MVC application. so that I was following the steps given over here
I followed exact steps what are given, so I think no need to give code here. But In my action as:
public bool signin(string token)
{
// string token = token_url;
RPXLib.RPXService service = new RPXLib.RPXService(new RPXLib.RPXApiSettings("https://singlesignontest.rpxnow.com/api/v2/auth_info", "56fd9a76a5da4dffb9a437fe09564544b209c622"));
try
{
RPXLib.Data.RPXAuthenticationDetails userDetails = service.GetUserData(token); //*Exception here*
return true;
}
catch (RPXLib.Exceptions.RPXAuthenticationErrorException ex)
{
} return false;
}
I am getting exception at denoted line of code. I am getting token value properly. but could not proceed a head. Exception is :
The remote server returned an error: (500) Internal Server Error.
Stack Trace:
[WebException: The remote server returned an error: (500) Internal Server Error.]
System.Net.HttpWebRequest.GetResponse() +5313085
RPXLib.RPXApiWrapper.Call(String methodName, IDictionary`2 queryData) in D:\Development\Projects (3rd Party)\RpxLib\src\RPXLib\RPXApiWrapper.cs:50
RPXLib.RPXService.GetUserData(String authenticationDetailsIdentifier) in D:\Development\Projects (3rd Party)\RpxLib\src\RPXLib\RPXService.cs:156
SingleSignOn.Controllers.HomeController.signin(String token) in D:\ParallelMinds\Study Material\MVC\SingleSignOn\SingleSignOn\Controllers\HomeController.cs:37
lambda_method(ExecutionScope , ControllerBase , Object[] ) +140
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +52
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +314
System.Web.Mvc.Controller.ExecuteCore() +105
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +39
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +59
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +44
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8674318
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
and asks for to open RPXLibWraper.cs from path.
D:\Development\Projects (3rd Party)\RpxLib\src\RPXLib\RPXApiWrapper.cs
what I have to do ?
i acctually had the same issue now and solved it. I am using their helper c# class and the path /api/v2/ is hard coded there. So you cant have that path in th https://rpxnow.come/api/v2/ string also, which is a inparam to the new Rpx() call. So just send in the url without the /api/v2/ to the new Rpx() call. Solved it for me.
Good luck!