DnsEndpointIdentity Leads to Runtime Error System.NotImplementedException - c#

I am trying to establish a network connection between my Xamarin.iOS client and an existing SOAP service. For this I have to foresee the service's DNS identity in the client. The corresponding command is:
DnsEndpointIdentity identity= new DnsEndpointIdentity("HelloWorldService");
Unfortunately, the command leads to a runtime error "System.NotImplementedException: The method or operation is not implemented.". The error is caused by the assignment of "HelloWorldService".
Object DnsEndpointIdentity belongs to assembly System.ServiceModel, which for iOS is available in version 2.0.5.0.
Everything looks fine for me and I have no clue what is going wrong.
May I ask you to help me?
Thank you very much,
Stefan

In most cases with Xamarin, if you come across "System.NotImplementedException: The method or operation is not implemented." it means that it has not been implemented in that current build of Xamarin.iOS. Unfortunately it's quite a common issue surrounding SOAP services, most notably with WCF Services which I work with. A lot of the time it requires creating custom headers for authentication. But again this depends on what works for you.

Related

Azure website IE10/11 error SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

We are experiencing this error in IE10/11 and have spent the last 2 days researching about it and have not been able to find a solution. We are running a asp.net mvc 5 web application utilizing signalR in specific areas hosted on a azure website that is scaled up to 2 instances. We are using the Redis backplane mod to make sure our SignalR talks back to all instances of the application. The error is intermittent and causes the rest of the application to hang. We do not believe this is a SignalR issue because we removed the invocation of SignalR from the page and was still able to get the issue to occur.
We have tried the following
GET request before POST
Setting the charset=utf-8
Our JS libraries are update to date
We need to find a fix for this issue quickly so if anyone has any ideas I would be really greatful.
thanks in advance
One problem when scaling a SignalR application on more instances is that clients connected to a server only receive updates from other clients from the same server. (The messages are not automatically broadcast between all servers).
http://www.asp.net/signalr/overview/performance/scaleout-in-signalr
One solution is to have a backplane that automatically sends the messages between servers, so that any server has any message at any time so it can push updates to their connected interested clients.
There are two implementations that Microsoft explains in the link above, one using Redis Pub/Sub and the other using Azure Service Bus.
With Redis you simply get an instance running (it can be on Linux, Windows or in Azure) and configure each server to push messages and subscribe to messages on the same channel.
I hope it helps your problem (since you said that the problem is intermitent, I can assume that it appears when clients are connected to different instances of your application).
Good luck!
EDIT:
Thanks for updating your question.
Have a look at this SO post:
IE10/11 Ajax XHR error - SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3
And at this post:
http://www.kewlcodes.com/posts/5/SCRIPT7002-XMLHttpRequest-Network-Error-0x2ef3-Could-not-complete-the-operation-due-to-error-00002ef3
Good luck!
I also ran into this issue. In my case, I used IOwinContext.Request.ReadFormAsync() in my server code. I found out that if I send a post request with json content type, ReadFormAsync() hangs.
I solved it by checking if the request's content type is json, and if so, I use a different method to parse the body.

SOAP Send Error on deployment - System.ServiceModel.Channels.Message

I have developed a c# class library that communicates with a web service via WCF. A service reference was added from the WSDL. This was manipulated to facilitate the use of X509 certificates for signing the request.
An extremely simple test app that utilises the DLL works perfectly on my development machine.
However when deploying the test app to a new machine, the following response is returned:
SOAP Send Error
The operation 'inquirePreAuthorizationAsync' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When using System.ServiceModel.Channels.Message or types with MessageContractAttribute, the method must not use any other types of parameters.
I'm thinking this is a misleading message - due to the fact that it is working fine on the dev machine - and surely if there was an issue then it would occur on both machines?
Any help to work out what is happening would be much appreciated.
In case anyone else experiences the same issue - it turned out to be a .net issue.
Had customer re-install .net framework, and everything started working.
Cheers
Darren

Is there any way to use WCF Discovery in mono?

I'm trying to get WCF Discovery to work in mono 3.2.8. The mono web page mentions that a lot of the Discovery behavior should be there, but I can't get it to work via code set up or App.config setup. This works 100% in .net, so I know that at least the principles are correct.
This is similar to the unanswered question at:
WCF Udp Discovery in mono
but, my specific question is: Is there any way of using WCF Discovery in mono?
App.config setup gives this error:
[ERROR] FATAL UNHANDLED EXCEPTION: System.Configuration.ConfigurationErrorsException:
Error deserializing configuration section behaviors:
Invalid element in configuration. The extension name 'serviceDiscovery' is not
registered in the collection at system.serviceModel/extensions/behaviorExtensions
Code setup gives this error:
System.InvalidOperationException: Contract 'TargetService' is not implemented
in this service 'MyService'
I can provide the code if needed, but since I'm asking for another way that works I don't believe it's needed at this point.
If you reference Mono System.ServiceModel.Discovery in 4.5 - you'll note that there is a NotImplemented icon on CreateBehavior() (located at: System.ServiceModel.Discovery.Configuration.ServiceDiscoveryElement) which seems to be the root cause of my issue.
I am struggling with the same problem. I've tried a number of approaches, but I can't get it to work either. I think you've got to the root cause of the problem with CreateBehavior() being not implemented.
I did create a work-around for my application, although it's not as clean as a pure WCF solution. Using the mono project's Zeroconf implementation to publish the service and then browse for it on the client side (again with zeroconf) worked for me. After finding the service, I use the zeroconf results to create my WCF proxy.
My use for this is an internal service for internal clients on the same subnet, which makes this implementation relatively easy. I'm not sure if/how it works across subnets, but according to "Zero Configuration Networking: the Definitive Guide" (Cheshire, Seienberg), it can be done.

WebService error: {"The underlying connection was closed: An unexpected error occurred on a receive."}

I have been testing a vendors webservice for the past month which was working fine. Then one day it started timing out. After setting the timeout property higher I started getting this response back. I was told that no changes were made on their side and that they could not recreate my issue. I was also told that there was no changes made on our network.
I have been searching around for a day or two here but have proved fruitless on my attempts to get closer to a solution. At this point I truly believe it is on their end but my question is, is there a way to prove more definitively where the issue is short of having their server logs? The other wrinkle here which makes me feel it is their problem is that they have another webservice which I can still get valid responses back from.
I use fiddler2 but I don't know if I can test a webservice with the request builder, it doesn't seem to work.
My setup is as follows I am using visual studio 2008 C# asp.net project with a web reference to this service.
Thank you very much in advance for your help
Use Wireshark to get network traces. It'll be tricky to diagnose if you're using HTTPS, but it's lower-level than Fiddler, which means they won't be able to claim that the proxying is causing problems.
Basically, you need to make sure that the request really is being sent, and that you're not getting a response back in time.

C# Error Report E-Mail - Web Service

Hey guys, I am trying to add the capability of my Windows Form application being able to send me an e-mail message when my application generates an error message. How do I setup a web service for my application? Any feedback would be greatly appreciated.
You don't need a web service for something like this.
You can use the MailMessage class from the System.Net namespace - the trick is to use the correct SMTP server settings, possibly with the SmtpClient class. This is something you will have to get on your own - from your network admin or ISP.
Take a look at the Enterprise Library Exception Handling Application Block.
The Exception Handling Application Block is designed to address the most common tasks developers face when they write applications that use exception handling. These tasks are arranged according to scenarios. Each scenario gives an example of a real-world situation, discusses the exception handling functions the situation requires, and shows the code that accomplishes the task.
The goal of arranging these tasks according to scenarios is to give the code some context. Instead of displaying an isolated group of methods, with no sense of where they can best be used, scenarios provide a setting for the code and describe situations that are familiar to many developers whose applications must handle exceptions.
The scenarios are the following:
Logging an Exception
Wrapping an Exception
Replacing an Exception
Propagating an Exception
Displaying User-Friendly Messages
Notifying the User
Assisting Support Staff
Shielding Exceptions at WCF Service Boundaries
You don't need a Web Service to send emails.
If you really want to use a web service, I would think you would actually create the web service on a server that will listen for message from the client. You could setup the windows form application with a WCF client and setup a WCF server to receive messages, but I think this is overkill.
I personally would use the log4net framework and configure an SmtpAppender to send emails when you log an error. It's really elegant when you get the hang of it.

Categories