开发者

Can't add service reference

开发者 https://www.devze.com 2023-01-19 13:19 出处:网络
I have started learning WCF. I wrote a simple service to query a SQL relation through LINQ. [ServiceContract]

I have started learning WCF. I wrote a simple service to query a SQL relation through LINQ.

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = aspNetCompatibilityRequirementsMode.Allowed)]
public class Order_WCFService 
   {

    [OperationContract]    
    public List<Order> getOrders()
    {
        List<Order> orderList= null;

        try
        {
            orderList= DAL.GetList<Order>();
            return orderList;
  开发者_JAVA百科      }
        catch (Exception)
        {
            throw;
        }
    }     
}

This is located in ASP.NET-MVC project.

I have a simple silverlight application. It's in the same solution, but in a different project.

I would like to consume my service by a silverlight application.

I attempt to "Add Service Reference..." and in the left hand column I have a list of all available ASMX and WCF services. When I click on any of the services, it attempts to download service information, but fails after 10-20 seconds: "An error occured (details) while attempting to find services at..."

What am I doing wrong here?

Thank you

I'm 100% certain that services are functional because I can invoke them through AJAX.


Maybe a stupid question but was the service running when you attempted to add the service reference (if you are using the Visual Studio's built-in web server, was it started and the ASP.NET MVC project containing the service running)? Also you may try giving the full address of the WSDL in the Add Service Reference dialog instead of selecting it from a list after verifying that this WSDL is accessible in your browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消