|
-
Dec 22nd, 2010, 11:51 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] do not have access to operationcontract method
In my wcf project, I can see several operationcontracts
I do not see the new one I have just added i.e.
inside the interface class:
...
...
...
[OperationContract]
void WriteAllSQL(string strXML);
in the .svc.cs file
...
...
...
public void WriteAllSQL(string strXML)
{
...
...
}
On the client, when I create an instance to the wcf, I only see the previous operationcontracts and not the new ones.
Have i not done something correctly?
-
Dec 22nd, 2010, 12:48 PM
#2
Re: do not have access to operationcontract method
Hey,
Try updating the Service Reference within your client project.
Gary
-
Dec 23rd, 2010, 03:04 AM
#3
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
This is what is surprizing. I have updated the references many times. but in th esolution, the silverlight app does not see the new method in wcf.
BUT, using the wcf test client tool, it does see it.
-
Dec 23rd, 2010, 03:20 AM
#4
Re: do not have access to operationcontract method
In which case, try removing the service reference, and re-add it.
Gary
-
Dec 23rd, 2010, 03:36 AM
#5
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
-
Dec 23rd, 2010, 03:38 AM
#6
Re: do not have access to operationcontract method
Were there any warnings, or errors while the Service Reference was being created?
Certains DataTypes are not supported in Silverlight, and I have seen the methods that use them not appear in the Service Reference.
Gary
-
Dec 23rd, 2010, 03:39 AM
#7
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
No warning.
And even if I add any new methods, they will not be shown.
-
Dec 23rd, 2010, 04:37 AM
#8
Re: do not have access to operationcontract method
Ok, so to clarify...
You have a WCF Endpoint that exposed some methods. You created the Service Reference initially, and could see the methods. Now, you have added some new methods, but even though you update the service reference, you can't see these new methods. However, if you use the WCF Test Client, you can see all the methods.
Does that pretty much sum up where you are?
Gary
-
Dec 23rd, 2010, 04:45 AM
#9
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
That is correct.
As an extra test, I added a new .svc and added two public methods. and then republished the wcf into the virtual directory, etc...
The wcf test client.exe can see the new methods inside the new .svc whereas the methods can not be seen inside the silverlight app project aftering doing the usual add service reference, etc.
-
Dec 23rd, 2010, 05:19 AM
#10
Re: do not have access to operationcontract method
Can you show the definition of one of the methods that isn't working? What are the DataTypes that you are using?
-
Dec 23rd, 2010, 05:29 AM
#11
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
public void WriteToXML(string strXML)
{
try
{
Utilities.logfile("Begin WriteXML");
}
catch (Exception ex)
{
Utilities.logfile("error : ");
}
}
-
Dec 23rd, 2010, 05:31 AM
#12
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
Only th eold methods are shown.
Somehow the new methods are blocked fom being shown.
Could this be to do with security/permission settings that may have been changed ? (Nothing that I know of has been changed).
-
Dec 23rd, 2010, 05:34 AM
#13
Re: do not have access to operationcontract method
Hey,
I am really not sure what else to suggest at this point.
Is it possible that you can upload your project somewhere so that I can take a look?
Gary
-
Dec 23rd, 2010, 05:42 AM
#14
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
Do you think th eproblem is the silverlight application project not being able to see the wcf properly?
It seems the wcf side is ok, since the wcf test client.exe does indeed see all the methods in wcf.
-
Dec 23rd, 2010, 05:45 AM
#15
Re: do not have access to operationcontract method
This is what I am not sure of.
It certainly looks like it is the Silverlight side of things that is causing the problem, but I am really not sure what could be wrong.
Gary
-
Dec 23rd, 2010, 05:51 AM
#16
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
I now created a brand new solution with silverlight project. added servicesreferences to point to the existing wcf. Still does not see the new methods and it even doe snot see any methods within any new .svc files.
-
Dec 23rd, 2010, 06:01 AM
#17
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
gary,
Could this be to do with port number on my machine?
<endpoint address="http://localhost:1841/DM.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDM"
contract="FMService.IDM" name="BasicHttpBinding_IDM" />
-
Dec 23rd, 2010, 06:15 AM
#18
Re: do not have access to operationcontract method
Hey,
I don't see how that could be making some things come through, but then stopping others.
Gary
-
Dec 23rd, 2010, 06:19 AM
#19
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
I even did clean and then build.
No difference.
-
Dec 23rd, 2010, 07:20 AM
#20
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
 Originally Posted by gep13
Hey,
I don't see how that could be making some things come through, but then stopping others.
Gary
Have been doing extra checks...
It seems th eproblem is definitely to do with the silverlight application project wher eit does not see the new methods inside the wcf project.
Created a new solution with new silverlight application project as well as new wcf project.
the silverlight pages do see the new .svc files and their methods...
Still not sure what the problem is in that silverlight app.
-
Dec 23rd, 2010, 08:16 AM
#21
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
Gary,
Still looking at this issue, and so trie again by adding a new .svc to the wcf project. Then in silverlight project, in addingservices... ths following error is shown when usingthe new service. can you see if there is something that can show what the problem is please?
There was an error downloading 'http://localhost:1841/AnotherService.svc'.
The request failed with the error message:
--
<html>
<head>
<title>The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>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.
<br><br>
<b> Exception Details: </b>System.InvalidOperationException: The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.<br><br>
<b>Source Error:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code>
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.</code>
</td>
</tr>
</table>
<br>
<b>Stack Trace:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
[InvalidOperationException: The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.]
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +51902
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1440
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +615
[ServiceActivationException: The service '/AnotherService.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..]
System.Runtime.AsyncResult.End(IAsyncResult result) +679246
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +234
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +355
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
</pre></code>
</td>
</tr>
</table>
<br>
<hr width=100% size=1 color=silver>
<b>Version Information:</b>*Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
</font>
</body>
</html>
<!--
[InvalidOperationException]: The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
[ServiceActivationException]: The service '/AnotherService.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'FServices.AnotherService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService)
at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
--.
Metadata contains a reference that cannot be resolved: 'http://localhost:1841/AnotherService.svc'.
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
If the service is defined in the current solution, try building the solution and adding the service reference again.
-
Dec 23rd, 2010, 09:14 AM
#22
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
Gary,
Could this be to do with namespaces?
Everytime I add a new .svc file the namespace becomes FService but I have changed the namespaces for all the files. ?
-
Dec 23rd, 2010, 10:26 AM
#23
Re: do not have access to operationcontract method
Hey,
I don't think you should need to alter the namespaces at all, this is not something that I have ever had to the do. The proxy class that gets created for the service reference is based on the name that you first give it when you add the service reference.
Is it possible that you can upload your sample project so that I can take a look, along with steps to reproduce the problem that you are having?
Gary
-
Dec 24th, 2010, 06:36 AM
#24
Thread Starter
Fanatic Member
Re: do not have access to operationcontract method
The problem was solved by creating a new wcf project.
Thank you for your time Gary
-
Dec 24th, 2010, 06:38 AM
#25
Re: [RESOLVED] do not have access to operationcontract method
Hey,
Glad to hear that you got it sorted out. Still don't have an explanation as to what happened though 
Gary
-
Dec 24th, 2010, 06:49 AM
#26
Thread Starter
Fanatic Member
Re: [RESOLVED] do not have access to operationcontract method
Me neither.
Hope I do not have to go through that again.
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|