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
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.
I am building a WCF service based on a given wsdl reference service given by Readify as a part of its technical interview process. What I did is that I built a client application that explores the methods exposed through this WCF, and then I started implementing my own version from this WCF.
I have finished the coding and the hosting part for my WCF version, and I had built another client that tests the results return from both WCFs, and everything seems okay. However, when I pass my WCF URL to the Readify testing app, it gives me this message:
I couldn't connect to that service with the contract I expected. The exception message was: There was no endpoint listening at {My WCF URL} that could accept the message.
Although, I am sure that the methods names and parameter types and the returned are the same.
Any hint???
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.
I have a WCF web service written in .NET 4.5 which is working fine.
The client I am using to call it (a SQL CLR stored procedure) has to use .NET 2 because it's for a Sql Server (2005).
When I test the web service using the built in WCF test client, everything works fine. Likewise, if I build a client using .NET 3+ with svcutil.exe it also works.
However, since I have to use .NET 2 the only solution I found was to use wsdl.exe to generate the client (original question) - which it did successfully, except I haven't manage to get it working.
I get the error The message with Action 'action removed' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
I found this question, however it recommends looking into the EndpointDispatcher class which I'm not using since I'm on .NET 2.0.
As far as I know all of my namespaces are the same - yet still no luck. I have also tried using the service trace utility but it doesn't seem to show me anything useful.
Is it even possible to use a client made in this manner with a service this way? Or are the endpoints permanently incompatible?
I ended up regenerating my client with wsdl on the off chance I'd changed something, turns out I had. The client updated my namespaces and everything worked from that point on.
I am trying to use a SOAP Web Service provided by a third party. I am having trouble getting the service to work correctly in .NET 3.5. I have added it as a web reference and all seems to go well. Problem is when I call the service all I get returned is a NULL object. I have worked with the provider and there service appears to be working correctly. He did mention:
"We are using Axis2 Document/Literal and support SOAP 1 and 2."
I am not exactly sure what that means as I am a semi-newbie to using Web Services. Do I need to change some configuration parameters or something in .NET to get this service to work correctly?
From my experience, web service interoperability isn't the magic it claims to be. Especially, between .NET and Java.
Axis2 is a Java web service "engine"
Document/Literal is a style of writing a WSDL that results in a special SOAP appearance
SOAP 1 and 2 (you probably know) the message format and specific versions thereof
all I get returned is a NULL object
Is not much to start with, could you provide more information?
I would recommend, that you try to intercept the exchanged SOAP messages (you can use tcpmon) and check if they are valid. You would probably get an exception if the remote service can't handle your request so I guess your client as some trouble parsing the response. Additionally, you can use soapUI to generate example request to see what a valid request should look like.
Doc/lit (and at least SOAP 1) ought to work with WCF, but I'm not sure how the legacy (pre-.NET 3.0) web service client deals with that.
Did you, in Visual Studio, add a web reference or a service reference? If you added a web reference, you are not using WCF, which may be the reason it's not working. If this is the case, you should delete the web reference and see if adding a service reference instead helps.
It sounds like the proxy that you have generated (via add web reference) is not de-serializing the xml into the type you expect.
As wierob suggests the first thing I would do is trace the messages that you send to the service and the response you receive - that way you can examine the xml you can check that the proxy is creating a suitable request message and see whether the response does contain data that is not being de-serialized into the object you expect
As well as tcpmon you could use fiddler (from microsoft) to trace the traffic or the simplest would be to switch on the message tracing in WCF to log the request and response to files which could then you examined in the service trace viewer tool
With these kind of interoperability issues I find the best thing is to look at the message "on the wire" first - you may then have to tweak the wsdl so that the proxy gets generated correctly or hand craft the proxy yourself
If you post the wsdl and your proxy that might give us a clue as to the issues