2011-02-15 3 views
1

J'utilise svcutil pour générer le code de proxy pour le web service endpoint qui suit la norme OGC CSW 2.0.2 (07-006r1) pour les services de catalogue.Pourquoi le code proxy est-il généré par svctuil si petit?

J'ai téléchargé le entire OGC schema files et les ai placés dans mon répertoire "D:/temp/OGCSchemas /".

Le schéma qui m'intéresse est CSW, mais le schéma CSW inclut et importe d'autres schémas et c'est pourquoi j'ai téléchargé l'ensemble.

Ma question est la suivante: Pourquoi le code du proxy est-il si petit? Je ne peux pas utiliser ça, n'est-ce pas? La génération de code a-t-elle été interrompue par l'erreur/avertissement que je reçois?

Ceci est mon svcutil excecution:

C:\Windows\system32>svcutil D:\temp\OGCSchemas\csw\2.0.2\http-binding.wsdl D:\temp\OGCSchemas\csw\2.0.2\xml-interfaces.wsdl D:\tem 
p\OGCSchemas\csw\2.0.2\responses.wsdl D:\temp\OGCSchemas\csw\2.0.2\CSW-discovery.xsd D:\temp\OGCSchemas\csw\2.0.2\CSW-publication. 
xsd D:\temp\OGCSchemas\ows\1.0.0\owsExceptionReport.xsd D:\temp\OGCSchemas\csw\2.0.2\record.xsd D:\temp\OGCSchemas\ows\1.0.0\owsAl 
l.xsd D:\temp\OGCSchemas\filter\1.1.0\filter.xsd D:\temp\OGCSchemas\csw\2.0.2\rec-dcterms.xsd D:\temp\OGCSchemas\csw\2.0.2\rec-dcm 
es.xsd D:\temp\OGCSchemas\ows\1.0.0\owsGetCapabilities.xsd D:\temp\OGCSchemas\filter\1.1.0\expr.xsd D:\temp\OGCSchemas\filter\1.1. 
0\sort.xsd D:\temp\OGCSchemas\filter\1.1.0\filterCapabilities.xsd D:\temp\OGCSchemas\gml\3.1.1\base\geometryAggregates.xsd D:\temp 
\OGCSchemas\ows\1.0.0\owsServiceIdentification.xsd D:\temp\OGCSchemas\ows\1.0.0\owsServiceProvider.xsd D:\temp\OGCSchemas\ows\1.0. 
0\owsOperationsMetadata.xsd D:\temp\OGCSchemas\gml\3.1.1\base\geometryPrimitives.xsd D:\temp\OGCSchemas\ows\1.0.0\owsDataIdentific 
ation.xsd D:\temp\OGCSchemas\ows\1.0.0\ows19115subset.xsd D:\temp\OGCSchemas\ows\1.0.0\owsCommon.xsd D:\temp\OGCSchemas\gml\3.1.1\ 
base\geometryBasic2d.xsd D:\temp\OGCSchemas\gml\3.1.1\base\geometryBasic0d1d.xsd D:\temp\OGCSchemas\gml\3.1.1\base\measures.xsd D: 
\temp\OGCSchemas\gml\3.1.1\base\units.xsd D:\temp\OGCSchemas\gml\3.1.1\base\dictionary.xsd D:\temp\OGCSchemas\gml\3.1.1\base\gmlBa 
se.xsd D:\temp\OGCSchemas\gml\3.1.1\base\basicTypes.xsd D:\temp\OGCSchemas\xlink\1.0.0\xlinks.xsd /out:D:\temp\ogc.csw.proxy.cs 
Microsoft (R) Service Model Metadata Tool 
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1] 
Copyright (c) Microsoft Corporation. All rights reserved. 

Error: Cannot import wsdl:binding 
Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled. 
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.opengis.net/cat/csw/2.0.2/http']/wsdl:binding[@name='csw-PO 
ST'] 


Generating files... 
D:\temp\ogc.csw.proxy.cs 

Et voici le fichier proxy ogc.csw.proxy.cs elle génère. (Très petit)

[assembly: System.Runtime.Serialization.ContractNamespaceAttribute("http://www.opengis.net/ows", ClrNamespace="www.opengis.net.ows")] 

namespace www.opengis.net.ows 
{ 
    [System.Diagnostics.DebuggerStepThroughAttribute()] 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 
    [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")] 
    [System.Xml.Serialization.XmlRootAttribute(IsNullable=false)] 
    public partial class ExceptionReport : object, System.Xml.Serialization.IXmlSerializable 
    { 

     private System.Xml.XmlNode[] nodesField; 

     private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("ExceptionReport", "http://www.opengis.net/ows"); 

     public System.Xml.XmlNode[] Nodes 
     { 
      get 
      { 
       return this.nodesField; 
      } 
      set 
      { 
       this.nodesField = value; 
      } 
     } 

     public void ReadXml(System.Xml.XmlReader reader) 
     { 
      this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader); 
     } 

     public void WriteXml(System.Xml.XmlWriter writer) 
     { 
      System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes); 
     } 

     public System.Xml.Schema.XmlSchema GetSchema() 
     { 
      return null; 
     } 

     public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas) 
     { 
      System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName); 
      return typeName; 
     } 
    } 
} 

EDIT # 1 Après avoir lu Yaron Naveh's blog j'ai réalisé svcutil n'aime pas contraignant http (je suppose que la façon dont l'OGC l'a spécifié). J'ai donc remplacé le http-binding.wsdl pour le soap-binding.wsdl et tout fonctionne sans erreur et un énorme fichier proxy est généré comme prévu.

+0

Il semble que l'un de vos XSD comporte des erreurs. –

+0

@S M: Savez-vous comment je peux déterminer lequel? – capdragon

+0

'XPath à Erreur Source: //wsdl:definitions[@targetNamespace='http://www.opengis.net/cat/csw/2.0.2/http']/wsdl:binding[@name='csw-POST '] ' –

Répondre

0

J'ai eu le même problème. Mon WSDL ne contenait aucune importation XSD et avait 3 liaisons: Http, Soap11 et Soap12. Retrait de la HttpBinding résolu le problème.

De plus, l'utilisation de XmlSerialized n'a pas aidé.

Questions connexes