Have had troubles with WCF in Silverlight for two weeks Help!!!
-
Hi I may have trouble to explain my problem but I will try. I have made a Silverlight Application, in which I added a WCF Service. I added the servicereference to the project. When I run it in VS it works great and when I publish it in IIS it works great. But when I'm trying to deploy or what it's called on the webserver, it gives me the error 405 . I can see in the web development helper that it doesn't download, or what that is called, the clientaccesspolicy.xml. The clientaccesspolicy.xml and crossdomain.xml file are placed in the root. This is my web.config
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="AcceditWeb.Web.ServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <services> <service behaviorConfiguration="AcceditWeb.Web.ServiceBehavior" name="AcceditWeb.Web.Service"> <endpoint address="" binding="basicHttpBinding" contract="AcceditWeb.Web.IService"> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> </system.serviceModel> </configuration>
This is my ServiceReference.config which is placed in AcceditWeb.xap in the directory ClientBin
lt;configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> <binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://thewebsite.thewebserver.se/Service.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference.IService" name="BasicHttpBinding_IService" /> </client> </system.serviceModel> </configuration>
This is my
-
Hi I may have trouble to explain my problem but I will try. I have made a Silverlight Application, in which I added a WCF Service. I added the servicereference to the project. When I run it in VS it works great and when I publish it in IIS it works great. But when I'm trying to deploy or what it's called on the webserver, it gives me the error 405 . I can see in the web development helper that it doesn't download, or what that is called, the clientaccesspolicy.xml. The clientaccesspolicy.xml and crossdomain.xml file are placed in the root. This is my web.config
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="AcceditWeb.Web.ServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <services> <service behaviorConfiguration="AcceditWeb.Web.ServiceBehavior" name="AcceditWeb.Web.Service"> <endpoint address="" binding="basicHttpBinding" contract="AcceditWeb.Web.IService"> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> </system.serviceModel> </configuration>
This is my ServiceReference.config which is placed in AcceditWeb.xap in the directory ClientBin
lt;configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> <binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://thewebsite.thewebserver.se/Service.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference.IService" name="BasicHttpBinding_IService" /> </client> </system.serviceModel> </configuration>
This is my
You are publishing to an IIS server, correct? Is the server you are publishing to configured for Silverlight[^]? Is the endpoint address in your ServiceReferences.ClientConfig correct? Can you connect to the service with the WCF Test Client[^] ?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You are publishing to an IIS server, correct? Is the server you are publishing to configured for Silverlight[^]? Is the endpoint address in your ServiceReferences.ClientConfig correct? Can you connect to the service with the WCF Test Client[^] ?
Mark Salsbery Microsoft MVP - Visual C++ :java:
Hi thanks for your answer. Yes I think they are using IIS 5, as web development helper says. I don't know if the server we are hosting to are configured for Silverlight. I think the endpointadress is right. It has the adress where the service.svc is placed. http://website.teliaweb.se/service.svc No I can not connect to the service with WcfTestClient.exe. I get this error messages. Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata. and Error: Cannot obtain Metadata from http://website.teliaweb.se/service.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://website.teliaweb.se/service.svc Metadata has a reference which can't be read. http://website.teliaweb.se/service.svc. The remote server returned an unexpected answer: (405) Method not allowed. The remote server returned an error: (405) Method not allowed.HTTP GET Error URI: http://website.teliaweb.se/service.svc Couldn't define the document type at URL:en http://website.teliaweb.se/service.svc as a known documenttype.The error message from every known type can help you find the solution for this problemt:- Rapport fr†n DISCO-dokument „r The name can't start with the sign %, hexadecimalt value 0x25. Rad 1, position 2..- Rapport from WSDL-dokument „r ther is an error in the XML-document (1, 2).. - The name can't start with the sign %, hexadecimalt value 0x25. Rad 1, position 2.- Rapport from XML-schema „r The name can't start with the sign %, hexadecimalt v„rde 0x25. Rad 1, position 2.. I have tried to translate the error message to english, hope you understand. Hope also this can help you to help me further. Thanks Fia
-
Hi thanks for your answer. Yes I think they are using IIS 5, as web development helper says. I don't know if the server we are hosting to are configured for Silverlight. I think the endpointadress is right. It has the adress where the service.svc is placed. http://website.teliaweb.se/service.svc No I can not connect to the service with WcfTestClient.exe. I get this error messages. Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata. and Error: Cannot obtain Metadata from http://website.teliaweb.se/service.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://website.teliaweb.se/service.svc Metadata has a reference which can't be read. http://website.teliaweb.se/service.svc. The remote server returned an unexpected answer: (405) Method not allowed. The remote server returned an error: (405) Method not allowed.HTTP GET Error URI: http://website.teliaweb.se/service.svc Couldn't define the document type at URL:en http://website.teliaweb.se/service.svc as a known documenttype.The error message from every known type can help you find the solution for this problemt:- Rapport fr†n DISCO-dokument „r The name can't start with the sign %, hexadecimalt value 0x25. Rad 1, position 2..- Rapport from WSDL-dokument „r ther is an error in the XML-document (1, 2).. - The name can't start with the sign %, hexadecimalt value 0x25. Rad 1, position 2.- Rapport from XML-schema „r The name can't start with the sign %, hexadecimalt v„rde 0x25. Rad 1, position 2.. I have tried to translate the error message to english, hope you understand. Hope also this can help you to help me further. Thanks Fia
fiaolle wrote:
Couldn't define the document type at URL:en http://website.teliaweb.se/service.svc as a known documenttype.
It looks like IIS isn't configured right to host the WCF service. Are you able to get the Silverlight app or is an error returned there too?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
fiaolle wrote:
Couldn't define the document type at URL:en http://website.teliaweb.se/service.svc as a known documenttype.
It looks like IIS isn't configured right to host the WCF service. Are you able to get the Silverlight app or is an error returned there too?
Mark Salsbery Microsoft MVP - Visual C++ :java:
Hi I can run the silverlight application but when I'm using the wcf service I'm getting the error, nothing happens. I can see in the web development helper that the clientaccesspolicy.xml isn't reached. And the clientaccesspolicy.xml is placed in the root. Fia
-
Hi thanks for your answer. Yes I think they are using IIS 5, as web development helper says. I don't know if the server we are hosting to are configured for Silverlight. I think the endpointadress is right. It has the adress where the service.svc is placed. http://website.teliaweb.se/service.svc No I can not connect to the service with WcfTestClient.exe. I get this error messages. Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata. and Error: Cannot obtain Metadata from http://website.teliaweb.se/service.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://website.teliaweb.se/service.svc Metadata has a reference which can't be read. http://website.teliaweb.se/service.svc. The remote server returned an unexpected answer: (405) Method not allowed. The remote server returned an error: (405) Method not allowed.HTTP GET Error URI: http://website.teliaweb.se/service.svc Couldn't define the document type at URL:en http://website.teliaweb.se/service.svc as a known documenttype.The error message from every known type can help you find the solution for this problemt:- Rapport fr†n DISCO-dokument „r The name can't start with the sign %, hexadecimalt value 0x25. Rad 1, position 2..- Rapport from WSDL-dokument „r ther is an error in the XML-document (1, 2).. - The name can't start with the sign %, hexadecimalt value 0x25. Rad 1, position 2.- Rapport from XML-schema „r The name can't start with the sign %, hexadecimalt v„rde 0x25. Rad 1, position 2.. I have tried to translate the error message to english, hope you understand. Hope also this can help you to help me further. Thanks Fia
It sounds like Mark's got the right idea; here's a link with tools and tips to help get IIS configured correctly: http://blogs.msdn.com/wenlong/archive/2006/09/10/748294.aspx[^]
Adam Maras | Software Developer Microsoft Certified Professional Developer
-
Hi I can run the silverlight application but when I'm using the wcf service I'm getting the error, nothing happens. I can see in the web development helper that the clientaccesspolicy.xml isn't reached. And the clientaccesspolicy.xml is placed in the root. Fia
fiaolle wrote:
when I'm using the wcf service I'm getting the error
Thanks. It wasn't clear (to me) when you were getting the error.
fiaolle wrote:
the clientaccesspolicy.xml isn't reached. And the clientaccesspolicy.xml is placed in the root
I don't see anything indicating a cross-domain issue so I believe that's irrelevant at the moment. I don't think your WCF service is starting. I've never used IIS 5 for WCF (or ASP.NET) so I'm no help with configuration. Maybe Adam's link will help. The error indicates a problem at the time the .SVC file is used, and since your WCF service runs fine on your local IIS server, I don't think there's a problem there. That's why I think there's an IIS configuration issue on the target machine.
Mark Salsbery Microsoft MVP - Visual C++ :java: