`

C# 有关SOAP的工具选择问题

    博客分类:
  • C#
阅读更多

C# 对于SOAP来说 有1.2 工具和1.3工具

 

1.2 的SOAP工具叫做 wsdl.exe

1.3的SOAP工具叫做 svcutil.exe

...\Microsoft SDKs\Windows\v6.0A\bin

下面有这两个工具

很实用。

wsdl.exe -
    Utility to generate code for xml web service clients and xml web services
    using ASP.NET from WSDL contract files, XSD schemas and .discomap
    discovery documents. This tool can be used in conjunction with disco.exe.

wsdl.exe <options> <url or path> <url or path> ...

     - OPTIONS -

<url or path> -
    A url or path to a WSDL contract, an XSD schema or .discomap document.

/nologo
    Suppresses the banner.

/language:<language>
    The language to use for the generated proxy class.  Choose from 'CS',
    'VB', 'JS', 'VJS', 'CPP' or provide a fully-qualified name for a class
    implementing System.CodeDom.Compiler.CodeDomProvider.  The default
    language is 'CS' (CSharp).  Short form is '/l:'.

/sharetypes
    Turns on type sharing feature. This feature creates one code file with
    a single type definition for identical types shared between different
    services (namespace, name and wire signature must be identical).
    Reference the services with http:// URLs as command-line parameters
    or create a discomap document for local files.

/verbose
    Displays extra information when the /sharetypes switch is specified.
    Short form is '/v'.

/fields
    Generate fields instead of properties. Short form is '/f'.

/order
    Generate explicit order identifiers on particle members.

/enableDataBinding
    Implement INotifyPropertyChanged interface on all generated types
    to enable data binding. Short form is '/edb'.

/namespace:<namespace>
    The namespace for the generated proxy or template.  The default namespace
    is the global namespace. Short form is '/n:'.

/out:<fileName|directoryPath>
    The filename or directory path for the generated proxy code. The default
    filename is derived from the service name. Short form is '/o:'.

/protocol:<protocol>
    Override the default protocol to implement.  Choose from 'SOAP',
    'SOAP12', 'HttpGet', 'HttpPost'.

/username:<username>
/password:<password>
/domain:<domain>
    The credentials to use when connecting to a server that
    requires authentication. Short forms are '/u:', '/p:' and '/d:'.

/proxy:<url>
    The url of the proxy server to use for http requests.
    The default is to use the system proxy setting.

/proxyusername:<username>
/proxypassword:<password>
/proxydomain:<domain>
    The credentials to use when the connecting to a proxy server that
    requires authentication. Short forms are '/pu:', '/pp:' and '/pd:'.

/appsettingurlkey:<key>
    The configuration key to use in the code generation to read the default
    value for the Url property. The default is to not read from the config
    file. Short form is '/urlkey:'.

/appsettingbaseurl:<baseurl>
    The base url to use when calculating the url fragment. The
    appsettingurlkey option must also be specified. The url fragment is
    the result of calculating the relative url from the appsettingbaseurl
    to the url in the WSDL document. Short form is '/baseurl:'.

/parsableerrors
    Print errors in a format similar to those reported by compilers.

     - ADVANCED -

/server
    Server switch has been deprecated. Please use /serverInterface instead.
    Generate an abstract class for an xml web service implementation using
    ASP.NET based on the contracts. The default is to generate client proxy
    classes.

/serverInterface
    Generates interfaces for server-side implementation of an ASP.Net
    Web Service. An interface is generated for each binding in the wsdl
    document(s). The wsdl alone implements the wsdl contract (classes
    that implement the interface should not include either of the following
    on the class methods: Web Service attributes or Serialization
    attributes that change the wsdl contract). Short form is '/si'.

/parameters:<file>
    Read command-line options from the specified xml file. This allows you
    to specify options not available from command line such as choosing
    which type of asynchronous programming model is generated. For details,
    please see the tool documentation. Short form is '/par:'.

 

 

Syntax: svcutil.exe /validate /serviceName:<serviceConfigName>  <assemblyPath>*

 <assemblyPath> - The path to an assembly containing service types to be validated. The assembly must have an associated config file to
                  provide service configuration. Standard command-line wildcards can be used to provide multiple assemblies.

Options:

 /validate                        - Validate a service implementation. To validate a service, you must use the /serviceName option to
                                    indicate the service you would like to validate. If this option is used, an executable assembly with an
                                    associated config file must be passed as input. (Short Form: /v)
 /serviceName:<serviceConfigName> - The config name of a service to validate. To validate a service this option must be provided. Svcutil
                                    will search through the associated config files of all input assemblies for the service configuration.
                                    If the associated configuration file contain any extension types, the assemblies containing these types
                                    must either be in the GAC or explicitly provided using the /r option.
 /reference:<file path>           - Add the specified assembly to the set of assemblies used for resolving type references. If you are
                                    exporting or validating a service that uses 3rd-party extensions (Behaviors, Bindings and
                                    BindingElements) registered in config use this option to locate extension assemblies that are not in the
                                    GAC.  (Short Form: /r)
 /dataContractOnly                - Operate on Data Contract types only. Service Contracts will not be processed. (Short Form: /dconly)
 /excludeType:<type>              - The fully-qualified or assembly-qualified name of a service type to exclude from validation. (Short
                                    Form: /et)



                                   -= METADATA DOWNLOAD =-

Description: svcutil.exe can be used to download metadata from running services and save the metadata to local files. To download metadata,
    you must explicitly specify the /t:metadata option. Otherwise, client code will be generated. For http and https URL schemes svcutil.exe
    will try to retrieve metadata using WS-Metadata Exchange and DISCO. For all other URL schemes svcutil.exe will only try WS-Metadata
    Exchange. By default, svcutil.exe uses the bindings defined in the System.ServiceModel.Description.MetadataExchangeBindings class. To
    configure the binding used for WS-Metadata Exchange you must define a client endpoint in config that uses the IMetadataExchange
    contract. This can be defined either in svcutil.exe's config file or in another config file specified using the /svcutilConfig option.

Syntax: svcutil.exe /t:metadata  <url>* | <epr>

 <url> - The URL to a service endpoint that provides metadata or an URL that points to a metadata document hosted online.
 <epr> - The path to an XML file that contains a WS-Addressing EndpointReference for a service endpoint that supports WS-Metadata Exchange.



                             -= XMLSERIALIZER TYPE GENERATION =-

Description: svcutil.exe can pre-generate C# serialization code that is required for types that can be serialized using the XmlSerializer.
    svcutil.exe will only generate code for types used by Service Contracts found in the input assemblies.

Syntax: svcutil.exe /t:xmlSerializer  <assemblyPath>*

 <assemblyPath> - The path to an assembly containing Service Contract types. Serialization types will be generated for all Xml Serializable
                  types in each contract

Options:

 /reference:<file path> - Add the specified assembly to the set of assemblies used for resolving type references. (Short Form: /r)
 /excludeType:<type>    - Fully-qualified or assembly-qualified type name to exclude from export or validation. This option can be used when
                          exporting metadata for a service or a set of service contracts to exclude types from being exported. This option
                          cannot be used with the /dataContractOnly option. (Short Form: /et)
 /out:<file>            - Filename for the generated code. This option will be ignored when multiple assemblies are passed as input to the
                          tool. Default: derived from the assembly name. (Short Form: /o)



                                       -= EXAMPLES =-

 svcutil http://service/metadataEndpoint
    - Generate client code from a running service or online metadata documents.

 svcutil /dconly http://service/metadataEndpoint
    - Generate Data Contract types from a running service or online metadata documents.

 svcutil *.wsdl *.xsd /language:C#
    - Generate client code from local metadata documents.

 svcutil /dconly *.xsd /language:VB
    - Generate Data Contract types in VisualBasic from local schema documents.

 svcutil /t:metadata http://service/metadataEndpoint
    - Download metadata documents from running services

 svcutil myAssembly.dll
    - Generate metadata documents for Service Contracts and associated types in an assembly

 svcutil myServiceHost.exe /serviceName:myServiceName
    - Generate metadata documents for a service, and all associated Service Contracts and data types in an assembly

 svcutil myServiceHost.exe /dconly
    - Generate metadata documents for data types in an assembly

 svcutil /validate /serviceName:myServiceName myServiceHost.exe
    - Verify service hosting

 svcutil /t:xmlserializer myContractLibrary.exe
    - Generate serialization types for XmlSerializer types used by any Service Contracts in the assembly

 

0
0
分享到:
评论

相关推荐

    C#winform下WebService Soap应用

    在本文中,我们将详细介绍如何使用 C# 语言在 Winform 平台下开发 WebService Soap 应用,以实现列车时刻、手机归属、QQ 在线、航空时刻等查询工具。 WebService Soap 简介 WebService Soap 是一种基于 SOAP 协议...

    C#实现SOAP调用WebService.rar

    通常,当调试SOAP通信问题时,查看和理解这些XML字符串是至关重要的。 总结来说,C#调用SOAP WebService涉及了理解SOAP协议、创建客户端、配置终结点、调用服务方法以及异常处理。通过提供的压缩包中的文件,我们...

    c#2.0使用TraceExtension记录WebService的Soap日志

    总之,利用C# 2.0的TraceExtension记录SOAP日志是一个强大而灵活的工具,它可以帮助开发者更好地理解和调试Web服务。通过自定义的TraceExtension类,我们可以方便地捕获和记录SOAP请求与响应,从而提高开发效率和...

    C# SOAP Client-开源

    总的来说,这个开源的C# SOAP客户端为开发者提供了一个方便的工具,用于测试和评估SOAP服务的安全性。通过查看和理解源代码,开发者可以学习如何构建SOAP请求,如何处理响应,以及如何实现与Web服务的安全交互。同时...

    SOAP消息处理包

    4. **错误处理和调试工具**:SDK还提供错误处理机制,帮助开发者诊断和解决在发送或接收SOAP消息时可能出现的问题。这可能包括错误代码、堆栈跟踪以及调试日志等功能。 5. **安全支持**:SOAP消息可能涉及敏感信息...

    C# 代理类生成工具

    本篇文章将详细介绍"C# 代理类生成工具"及其在Visual Studio(VS)中的应用。 1. **Web服务代理类**:Web服务代理类是.NET框架自动生成的C#类,它封装了与Web服务通信的所有细节。这些类通常由`svcutil.exe`工具或...

    VS2015 C++和C++的通过SOAP的WebService,C++和C#的WebService发布和应用

    总的来说,VS2015为C++和C#开发者提供了强大的工具来创建和消费SOAP Web服务。无论是在C++中使用ATL还是在C#中使用ASP.NET,都可以实现跨平台、跨语言的通信,从而提升软件系统的可扩展性和互操作性。理解并掌握这些...

    拼接soap,判断soap是否连接成功,返回接口的信息,解析soap报文,解析后的soap转成实体

    总的来说,这个压缩包包含了一套完整的SOAP通信解决方案,从构建请求,到发送,再到解析响应并转换为Java实体,为处理SOAP Web服务提供了一个实用的工具集。对于需要处理SOAP接口的开发者来说,这是一个宝贵的资源。

    VS2015 C++和C++的通过SOAP的WebService,C++和C#的WebService发布和调用

    GSOAP是一个开源的C和C++ SOAP工具包,它允许开发者创建和使用SOAP Web服务。要开始使用GSOAP,你需要下载并安装GSOAP库,然后将其包含到你的VS2015项目中。GSOAP提供了代码生成工具,如`wsdl2h`和`soapcpp2`,它们...

    SOAP源码Probe

    它提供了一种直观的方式来查看和解析SOAP消息,帮助开发者找出潜在的问题。 `SoapMessageProbe` 是核心的SOAP消息探查器,它可能包含了解析、显示和记录SOAP消息的代码。这个组件允许开发者追踪Web服务调用的详细...

    SoapWebService.zip

    对于开发和测试SOAP Web服务,开发者通常会用到一些工具,如SOAPUI,它可以创建、发送和测试SOAP请求,帮助调试和验证服务接口。此外,了解WSDL(Web Service Description Language)也是重要的,WSDL是一个XML格式...

    C#写的自己股票及时查看工具(付源码)

    标题中的"C#写的自己股票及时查看工具"是一个基于C#编程语言开发的个人股票监控软件。这个工具利用了C#的强大功能,为用户提供实时的股票市场数据,帮助投资者跟踪其股票投资组合的表现。C#是一种面向对象的编程语言...

    C#调用JavaWebService

    调用WebService,最简单的办法当然是直接添加WEB引用,然后自动产生代理类,但是在调用JAVA的WebService时并没有这么简单,特别是对于SoapHeader的处理,通过C#添加Web引用方式访问JavaWebService的方法,除了string...

    免费短信工具(C#写的)

    标题中的“免费短信工具(C#写的)”表明这是一个利用C#编程语言开发的软件,主要用于发送短信。C#是一种面向对象的、类型安全的、现代化的编程语言,由微软公司开发,广泛应用于Windows平台上的应用程序开发,包括...

    SOAP_serialization.zip_Csharp SOAP_soap_soap C++_soap csharp

    在C#、C++以及C#(也就是.NET框架中的SOAP支持)中,SOAP序列化是将对象转换为可以发送通过网络的XML消息的过程,而反序列化则是将接收到的XML消息恢复为原始对象的过程。 在C#中,SOAP序列化是.NET框架的一部分,...

    c#调用java带身份验证webservice

    1. **生成代理类**:使用C#的`svcutil.exe`工具,通过提供Java Web服务的WSDL地址,可以自动生成一个客户端代理类。这个类包含了调用服务所需的方法、属性和事件。 2. **身份验证机制**:在调用Java Web服务时,...

    C#上位机实战开发指南

    因此,选择VS2015作为C#上位机开发工具是明智之选。 C#语法基础对于初学者而言是上位机开发入门的关键。C#作为一种高级语言,其语法与C语言存在很多相似之处,这也意味着拥有C语言基础的学习者可以较快地掌握C#。C#...

    SOAP.zip_Csharp SOAP_class A_soap

    本文将深入探讨如何使用C#语言和SOAP类来创建一个Web服务,以及涉及的相关知识点。 首先,我们需要理解C#中的SOAP类。在.NET框架中,System.Web.Services命名空间提供了一系列类来支持SOAP通信。`...

    VS2015 C++和C++的通过SOAP的WebService,gsoap工具

    本教程主要探讨如何在Visual Studio 2015 (VS2015) 中使用C++和C#通过SOAP(简单对象访问协议)来实现Web服务的发布与调用。我们将特别关注gSOAP工具,这是一个强大的库,用于生成C++代码以便处理SOAP消息。 首先,...

    C#示例代码WebApplication1_C#调用BPS相关接口的实现_gravityuja_

    - 这个问题通常出现在.NET框架中,尤其是当使用`wsdl.exe`工具生成的代理类时,针对那些可选的或者可以为null的SOAP参数。例如,如果你有一个名为`Age`的字段,生成的代理类可能会有一个对应的`AgeSpecified`布尔...

Global site tag (gtag.js) - Google Analytics