I have an existing web service (ASMX) which must also be highlighted as WCF ASMX must remain and preferably There will be no change on the client. As I have configured the following I service level has been created with CodeSmith and as long as I did not write these services, I know that they are okay because they have been used in the wild for many years. Names have been changed to save innocent .. grin.
The service level is a and I have also created an empty interface Now I'm one. Add the SVC file to the service level ... ... and I can access the Service Layer Web Configuring Config ... If I try to build Visual Studio 2010 for service and then create service reference, then I see both <.>> MyService of .ASMX and SSC versions. . Expanding the .svc branch in Insert Service Reference is the result of an error in referring an empty XML document. If I check the event log ... WebHost failed to process request Sender Notification: System. Servicemodel. Service Hosting Environment + Hosting Manager / 39449526 Exception: System. Servicemodel. Service Activation Exception: Service '/ System / MySite Service' can not be activated due to an exception during compilation. The exception message is that the name 'named' XXX.YYY.IMyService 'service' can not be found in the list of contracts implemented by MyService .. --- & gt; ... but the form of implementing I hope this makes sense. Please feel free to ask for some additional details. I have tried to be as elaborate as possible. (No IIS is included .. It is fully in Visual Studio 2010). Thank you. ImyService implements your code. Are you sure that this is XXX? YYY.IMyService. XXX.YYY.MyService class generated by CodeEsmith, which is decorated twice.
[Service ( Namespace = "http: //XXX.YYY")]
[webserver (namespace = "http: //XXX.YYY") Name = "MyService")]
XXX.YYY.IMyService implemented by
MyService . At this point I can consume ASMX service with no problem.
& lt;% @ ServiceHost language = "C #" debug = "true" service = "XXX.YYY.MyService"% & Gt;
& lt; System.serviceModel & gt; & Lt; Behavior & gt; & Lt; ServiceBehaviors & gt; & Lt; Transaction name = "MyServiceBehavior" & gt; & Lt; ServiceMetadata httpGetEnabled = "true" /> & Lt; Service debug includes ExceptionDetailInFaults = "true" /> & Lt; / Behavior & gt; & Lt; / ServiceBehaviors & gt; & Lt; / Behavior & gt; & Lt; Services & gt; & Lt; Service transaction support = "MyServiceBehavior" name = "XXX.YYY.MyService" & gt; & Lt; Endpoint binding = "basicHttpBinding" contract = "XXX.YYY.IMyService" & gt; & Lt; Identity & gt; & Lt; Dns value = "localhost" /> & Lt; / Identification & gt; & Lt; / Endpoint & gt; & Lt; Endpoint address = "Max" binding = "MaxHttpending" contract = "IMAXADEXXchange" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; /system.serviceModel>
MyService to
IMyService ...
I have tried to change the service attribute of the service for
MyService instead of the interface. But for client code breaks, any attempt to create an instance of the service fails because it is no longer an interface.
Comments
Post a Comment