function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
catherinecatherine 

Enterprise WSDL causes errors in VS 2005

Errors include:

Error    105    'Id' is not a member of 'basicSample_vb.sforce.Account'.    C:\Salesforce\Samples\AppExchange Developer Network\Visual Basic .Net\basicSample_vb_2005\Samples.vb    290    13    basicSample_vb

Error    110    Type 'sforce.sObject' is not defined.    C:\Salesforce\Samples\AppExchange Developer Network\Visual Basic .Net\basicSample_vb_2005\Samples.vb    362    58    basicSample_vb

Warnings include:

Warning    1    Type 'urn:enterprise.soap.sforce.com:ID' is not declared.    C:\Salesforce\Samples\AppExchange Developer Network\Visual Basic .Net\basicSample_vb_2005\Web References\sforce\enterprise.wsdl    9    12    basicSample_vb

Warning    102    Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared namespace.    C:\Salesforce\Samples\AppExchange Developer Network\Visual Basic .Net\basicSample_vb_2005\Web References\sforce\Reference.map    1    1    basicSample_vb

VS doesn't like the reference.map file at all:

<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Results>
    <DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="file:///C:/Salesforce/WSDL/enterprise.wsdl" filename="enterprise.wsdl" />
  </Results>
</DiscoveryClientResultsFile>

The problem appears to be in the definitions section of the wsdl.

<definitions
xmlns:tns="urn:enterprise.soap.sforce.com"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:fns="urn:fault.enterprise.soap.sforce.com"
xmlns:ens="urn:sobject.enterprise.soap.sforce.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:enterprise.soap.sforce.com"
xmlns="http://schemas.xmlsoap.org/wsdl/">

  <types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:sobject.enterprise.soap.sforce.com">
      <xsd:import namespace="urn:enterprise.soap.sforce.com" />
      <xsd:complexType name="sObject">
        <xsd:sequence>
          <xsd:element minOccurs="0" maxOccurs="unbounded" name="fieldsToNull" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" maxOccurs="1" name="Id" nillable="true" type="tns:ID" />
        </xsd:sequence>
      </xsd:complexType>


If I change the highlighted lines to the following,  the green line above becomes valid and the errors go away. All I get is a message saying that
"Warning    1    The 'http://www.w3.org/2001/XMLSchema:definitions' element is not declared. "


<definitions targetNamespace="urn:enterprise.soap.sforce.com"
             xmlns:tns="urn:enterprise.soap.sforce.com"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap"
             xmlns:fns="urn:fault.enterprise.soap.sforce.com"
             xmlns:ens="urn:sobject.enterprise.soap.sforce.com"
             xmlns:xsd="http://schemas.xmlsoap.org/wsdl/">
  <types>

I don't know a whole lot about wsdl files and namespace declarations, but something funny is going on here. Would VS 2005 be requiring different references ? I downloaded the sample applications including related wsdl, which had the same problems as my generated one.

catherinecatherine
*** oops. missed a change in the working wsdl

<definitions targetNamespace="urn:enterprise.soap.sforce.com"
             xmlns:xsd="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="urn:enterprise.soap.sforce.com"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:fns="urn:fault.enterprise.soap.sforce.com"
             xmlns:ens="urn:sobject.enterprise.soap.sforce.com"
             xmlns="http://www.w3.org/2001/XMLSchema">


DevAngelDevAngel
Hi Catherine,
 
How are you adding/updating the web reference?  I can't seem to duplicate the problems.
 
 
Cheers
catherinecatherine
Hi Dave.

Note first that it's the vb.net project, and I removed all trace of the sample reference before adding my one.
To add, I selected Add Web Reference, and then typed the location in the URL field...
C:\Salesforce\WSDL\enterprise.wsdl. The dialog loaded this ok. I renamed to sforce and clicked the Add Reference button. A copy was generated in my project's Web References folder, as well as the Reference.map, Reference.vb and all the datasource files (including one for sObject).

Following are the results one of my colleagues found. From his findings, looks like it might be a vb.net thing. I'll try the C# sample in VS, and also try importing a generated C# proxy.

C:> wsdl enterprise.wsdl
Schema validation warning: The value 'fns:API_CURRENTLY_DISABLED' is invalid according to its data type.
Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.
Writing file 'C:\Documents and Settings\<user>\Desktop\SforceService.cs'.

A cs file was produced so I think I can safely ignore the errors.

C:> csc /target:library *.cs
No Errors

C:> ildasm sforceservice.dll
Everything looks ok

Tried with VB…

C:> wsdl /language:VB enterprise.wsdl
Same warning as above

C:> vbc /target:library *.vb
Tonnes of errors. The important one being sObject is not defined. Checking the generate vb file proves that infact the class isn't there!!

=================

thanks,

Catherine

catherinecatherine
Loaded WSDL file into c# sample and an empty c# project.
Received 3 warnings along the lines of:

Warning    1    Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared namespace.    S:\Projects\TestClient\Web References\sforce\Reference.map    1    1    TestClient

When I open the project's Enterprise.wsdl file I get 101 more warnings:

Warning    59    Type 'urn:enterprise.soap.sforce.com:ID' is not declared.    S:\Projects\TestClient\Web References\sforce\enterprise.wsdl    980    16    TestClient

============

Also re-ran command line options as mentioned earlier (found these had been run using v1.1 rather than 2.0)
C:> wsdl enterprise.wsdl
generated no errors.

C:> vbc /target:library *.vb
also generated no errors.

===============

Looks like VS might be being stupid ?
nphxnphx
I am gettign the same results in vb vis studio 2005 - was there a solution to this issue?
 
Warning 1 Type 'urn:enterprise.soap.sforce.com:ID' is not declared. C:\path\App_WebReferences\sforce\salesforce.wsdl 9 12 C:\path\
DevAngelDevAngel
So, this is really odd since I use the enterprise and partner wsdl every release in vs 2005 to create/update the samples.  What version of the .net framework are you using?
XifierXifier
Dave,

I'm having the same problem as well, in C# this time, not that it matters.  I'm using VS 2005 with .NET.  This issue only seems to be occuring with the 9.0 partner WSDL; I imported the 8.0 WSDL earlier without incident.

-Marco
SuperfellSuperfell
The schema warnings are bogus and can be safely ignored.