You need to sign in to do that
Don't have an account?
catherine
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.
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.
<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">
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
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 ?
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