Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proxy class not available for Windows Phone 7 Reference to WCF Service

I have an existing WCF service that works. I've added a reference in Visual Studio 2010 for my Windows Phone app. The reference shows up and I see the methods when I check out the properties of it. The service is using basicHttpBinding. It seems the proxy class is never generated. I cannot reference it (yes - I'm checking the proper namespace)

I'm aware of the SlSvcUtil.exe utility - but that is supposed to not be necessary anymore. Any thoughts as to why my proxy class isn't being generated but the service reference is there?

Thanks!

EDIT: Wsdl file is as follows:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ProjectManager" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <xsd:schema targetNamespace="http://tempuri.org/Imports">
      <xsd:import schemaLocation="http://somesite/ProjectManager/ProjectManager.svc?xsd=xsd0" namespace="http://tempuri.org/" />
      <xsd:import schemaLocation="http://somesite/ProjectManager/ProjectManager.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
      <xsd:import schemaLocation="http://somesite/ProjectManager/ProjectManager.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/ProjectManager" />
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="IProjectManagerService_GetProjectList_InputMessage">
    <wsdl:part name="parameters" element="tns:GetProjectList" />
  </wsdl:message>
  <wsdl:message name="IProjectManagerService_GetProjectList_OutputMessage">
    <wsdl:part name="parameters" element="tns:GetProjectListResponse" />
  </wsdl:message>
  <wsdl:message name="IProjectManagerService_GetProjectFiles_InputMessage">
    <wsdl:part name="parameters" element="tns:GetProjectFiles" />
  </wsdl:message>
  <wsdl:message name="IProjectManagerService_GetProjectFiles_OutputMessage">
    <wsdl:part name="parameters" element="tns:GetProjectFilesResponse" />
  </wsdl:message>
  <wsdl:portType name="IProjectManagerService">
    <wsdl:operation name="GetProjectList">
      <wsdl:input wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectList" message="tns:IProjectManagerService_GetProjectList_InputMessage" />
      <wsdl:output wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectListResponse" message="tns:IProjectManagerService_GetProjectList_OutputMessage" />
    </wsdl:operation>
    <wsdl:operation name="GetProjectFiles">
      <wsdl:input wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectFiles" message="tns:IProjectManagerService_GetProjectFiles_InputMessage" />
      <wsdl:output wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectFilesResponse" message="tns:IProjectManagerService_GetProjectFiles_OutputMessage" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="BasicHttpBinding_IProjectManagerService" type="tns:IProjectManagerService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="GetProjectList">
      <soap:operation soapAction="http://tempuri.org/IProjectManagerService/GetProjectList" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetProjectFiles">
      <soap:operation soapAction="http://tempuri.org/IProjectManagerService/GetProjectFiles" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ProjectManager">
    <wsdl:port name="BasicHttpBinding_IProjectManagerService" binding="tns:BasicHttpBinding_IProjectManagerService">
      <soap:address location="http://somesite/ProjectManager/ProjectManager.svc" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
like image 330
Adam Tuliper Avatar asked May 26 '11 03:05

Adam Tuliper


4 Answers

This has happened to me.

Not sure what causes it.

What works for me is to close down Visual Studio, reopen, right click on the service and click Update Service Reference.

like image 111
Steve Chadbourne Avatar answered Oct 04 '22 13:10

Steve Chadbourne


I got exactly the same problem. And installing the "Windows Phone Developer Tools Fix" solved the problem.

Here is the link to download the fix: http://download.microsoft.com/download/6/D/6/6D66958D-891B-4C0E-BC32-2DFC41917B11/VS10-KB2486994-x86.exe

Good luck!

like image 34
Cui Pengfei 崔鹏飞 Avatar answered Oct 04 '22 13:10

Cui Pengfei 崔鹏飞


I had this problem.
Adding the service again with another name solved the problem for me once or twice.
Slsvc works every time and is much nicer to work with when checking into TFS. Not sure if this is TFS related or not.

like image 42
Jimmy Engtröm Avatar answered Oct 04 '22 12:10

Jimmy Engtröm


Oddly enough - a month later it started working with no other installs. Its possible that a recent reboot 'fixed' it but thought I had rebooted prior as well - who knows though. Either way its working.

like image 20
Adam Tuliper Avatar answered Oct 04 '22 12:10

Adam Tuliper