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.
Related
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.
Background
I'm troubleshooting some issues with a .NET Web API 2 service. The issues are inconsistent, and from the requesting service, all we see are Connection Resets and Socket Exceptions. It is not even hitting the User Code/logging in the API, but for low level exceptions that doesn't rule the WEB API out as the culprit.
Research
A very useful tool in the past for troubleshooting similar issues in WCF was enabling WCF Tracing. I'm looking for an equivalent that can show the low level Service Trace for the Web API.
I've found Global Error Handling and I've used packages like Elmah in the past. but to my knowledge this only shows unhandled exceptions, as opposed to the entire trace of the Service like the svclog does.
I also know about Fiddler and Wireshark, and while these are excellent tools for http tracking and low level protocol sniffing. At this point, I'm interested more in what the .NET service thinks it's receiving and how it's processing those actions, rather than if packets are making it over the wire.
Summary
Is there an equivalent for Web API 2 to WCF .svclog? With particular focus on the low level service interactions with bytes/requests.
Edit
I have accepted the best answer, both answers pointed to the same form of tracing. It's worth mentioning, that for this specific issue the tracing did not show any additional information, however I do believe it is the closest tracing Web API has to WCF svclog.
There is no direct equivalent solution in WebAPI but they have added some tracing capabilities in V2. You can refer to the article below.
Tracing in ASP.NET Web API 2
If you have connection issues, I would also check the IIS logs and the httperr logs that may give you more details on such issues.
WCF and WebAPI are night and day different. WCF has a complex messaging infrastructure, with lots of middleware that requires the level of tracing they supply to troubleshoot.
WebAPI on the other hand is quite simple, and there is very little that sits between the request itself and your code. Any problem in that code presents itself as YSOD (ie a 500 error, which if custom errors are disabled will show the exception). Just like an MVC or even standard ASP.NET application.
Now, there is some tracing available, but it is not to svclog's like with WCF. There is information here:
http://blogs.msdn.com/b/roncain/archive/2012/04/12/tracing-in-asp-net-web-api.aspx
You will have to write your own logger, although maybe there are some loggers out there you can find already.
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
I have been given a "working" SoapUi 4.0.1 project that accesses an existing 3rd party service. The project has two xml requests that I can run to see, in SoapUi , a "found" and a "not found" response.
Along with the project is a wsdl file a couple of certificate files (for message security) and a bunch of xml schemas.
I've been told to implement a c# client that uses the service based on the "documentation" provided by the above.
I'm not experienced in the intricacies of WCF configuration nor SoapUi. There, at least, there seems to be a mismatch between the terminology SoapUi uses and that I see in the WCF configuration tool.
I'm looking for advice, hints, pointers on duplicating the SoapUi calls in my .NET code, perhaps a terminology mapping between the two tools would be a good start.
First you need to create a service proxy using the right-click "Add Service Reference" in Visual Studio or by running the SVCUTIL.EXE tool from a VS command-line. This will provide you with both a basic configuration file as well as a client implementation. All you need to do this is the actual metadata files (WSDL+XSD) or a URL to a hosted version of it.
It is not clear weather the SoapUI project you have makes client requests to the actual service or if it uses the built-in MockService feature where SoapUI hosts a 'fake' service instance. Either way the MockService feature can be your best friend doing WCF development.
If you are using the SoapUI MockService feature and do not have the original WSDL or access to it you can then use the metadata exposed by the MockService. One way of finding the link to the WSDL is by clicking the link button:
Copy the URL you get from there and generate the proxy from a Visual Studio command-prompt:
svcutil.exe http://localhost:8088/mockKramerServiceSoap?WSDL
SoapUI has one really great feature when trying to replicate SOAP calls in WCF. You can examine requests coming into the MockService from the .NET proxy and compare them with the calls made from SoapUI.
Hopefully this helped you getting started.
I have written a WCF service that uploads a file to the server. It is configured to stream the file, because they may be fairly large. I set transferMode = Streamed in my web.config and set various config size settings to fairly large-ish sizes.
This work fine for my test client. I had to set the client configurations manually to have transferMode= Streamed -- by default when I included the service reference it had set it to Buffered.
But the guy who is consuming my service is complaining about having to do that manual step. He keeps telling me something is wrong with my service and I need to fix it. I don't see anything that I can "do" about the settings not propagating to the client. And it work fine if he uses the config settings I sent him.
Is there something I should be doing? And if not is there some kind of proof I can offer this person to convince him my service is not broken? Anyone have a link to an article explaining this?
If the guy's platform, who is consuming your service, is .Net, then you can create client library with correct configuration, which consumes your service and give him to use it.
There are well known article WCF the Manual Way… the Right Way