title: troubles with generating a service reference
body: <p>I have to build a .Net application that consumes a bunch of web service. This web service runs under weblogic. The WSDL of the web services mention a XSD file that describes the types.</p>
  
  <p>When I try to add a "Service reference" with VS studio, I have some errors :</p>
  
  <blockquote>
    <p>Warning   1   Custom tool warning: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
    Error: Schema with target namespace 'http://mycustomer/ws/types' could not be found.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://mycustomer/ws/wsdl']/wsdl:portType[@name='lbWebPT']  C:\Projects\mycustomerproject\Service References\ClientService\Reference.svcmap </p>
  </blockquote>
  
  <p>X3 for the portType, Binding and port elements of the wsdl file.</p>
  
  <p>I was guessing this was because of the missing types defined in the xsd file. To workaround this error, and also to avoid duplicate code, I run the following command on my xsd file (in a pre-build event command line) :</p>
  
  <blockquote>
    <p>"%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\xsd.exe"  "$(ProjectDir)xsdofmycustomer.xsd"  /namespace:"MyCustomer.WebServices.Types"  /c /o:"$(ProjectDir)."</p>
  </blockquote>
  
  <p>this command successfully produces a code file with the types and with the correct namespace defined in the <code>XmlRootAttribute</code>.</p>
  
  <p>this code has been put a dedicated VS project. The project where I'm trying to reference the service reference this project. However, the error is still occurring.</p>
  
  <p>What can I do to solve my problem ?</p>
  
  <p>PS: I was able to partially solve my problem using <code>svcutil.exe pathtowsdl pathtoxsd</code>, but I'd like to be able to maintain the reference in VS for ease of use.</p>
  
  <p>thx</p>