Compartir a través de


Invoking MfSvcUtil from the Command Line

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Use this format in your command line to invoke MfsvcUtil.exe for use in your development.

Running MfSvcUtil

JJ646594.collapse_all(en-us,VS.102).gifLocation

The MfSvcUtil tool can be found in the Tools subdirectory of your .NET Micro Framework installation. For example, C:\Program Files\Microsoft .NET Micro Framework\v2.0.3036\Tools

JJ646594.collapse_all(en-us,VS.102).gifUsage

To invoke MfSvcUtil from the command prompt, use the following form:

MfSvcUtil <input file> [/V] [/P:[Microframework|Win32]] [/C:[ContractFilename]]

Argument

Description

input file

The path of the WSDL file that specifies operations the service exposes. This file should have the .wsdl extension.

/V

Verbose option, to display extended output.

/P:[Microframework|Win32]

Specifies the target platform.

/C:[ContractFilename]

Specifies the name of the file that contains the data serialization classes. If this option is not specified, a default filename based on the name of the WSDL input file is assigned. For instance, if the WSDL input file is named SimpleService.wsdl, the serializer file will be named SimpleService.cs if no /C option is provided.

JJ646594.collapse_all(en-us,VS.102).gifExamples

MfSvcUtil.exe SimpleService.wsdl

MfSvcUtil.exe SimpleService.wsdl /V /P:Microframework

MfSvcUtil.exe SimpleService.wsdl /V /C:SimpleServiceContract.cs

JJ646594.collapse_all(en-us,VS.102).gifOutputs

MfSvcUtil generates three files from the WSDL:

  1. A contract class that defines data types for the client requests and server responses, in which data types are serialized to XML.

  2. A client proxy that derives from DpwsClient

  3. A hosted service that derives from DpwsHostedService

Defining a WSDL

Within your WSDL, elements for each type of message should be defined.

The following example is the WSDL definition of messages for sending a pair of values to a service and receiving a sum in response.

<!-- ========================================================== -->
<!-- TwoWay message -->
<!-- This verifies sending a pair of values to a service and
        receiving a sum in response -->

<xs:element name="TwoWayRequest" type="tns:TwoWayType" />
<xs:complexType name="TwoWayType">
    <xs:sequence>
        <xs:element name="X" type="xs:int" />
        <xs:element name="Y" type="xs:int" />
        <xs:any minOccurs="0" maxOccurs="unbounded"
        namespace="##other" processContents="lax" />
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>

<xs:element name="TwoWayResponse" type="tns:TwoWayResponseType" />
<xs:complexType name="TwoWayResponseType">
    <xs:sequence>
        <xs:element name="Sum" type="xs:int" />
        <xs:any minOccurs="0" maxOccurs="unbounded"
        namespace="##other" processContents="lax" />
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>