3.2.3 Microsoft .NET Web Service Client Programming Toolkit

Microsoft .Net 1.1/2.0 provides wsdl.exe in the .Net SDK package. It is a free development Microsoft toolkit. In the SALT simpapp sample, a .Net program is provided in the simpapp/dnetclient directory.

.Net Web service programming is easy and straightforward. Use the wsdl.exe utility and the SALT WSDL document to generate the stub code, and then reference the .Net object contained in the stub code/binary in business logic implementations.

Tip:

  • Do not use .Net program MIME attachment binding for CARRAY.

    Microsoft does not support SOAP communication MIME binding. Avoid using the WSDL document with MIME binding for CARRAY in .Net development.

    SALT supports base64Binary encoding for CARRAY data (the default WSDL document generation.)

  • Some RPC/encoded style SOAP messages are not understood by the GWWS server.

    When the SALT WSDL document is generated using RPC/encoded style, .Net sends out SOAP messages containing soapenc:arrayType. SALT does not support soapenc:arrayType using RPC/encoded style. A sample RPC/encoded style-generated WSDL document is shown in example below:

    Example: Sample RPC/encoded Style-Generated WSDL Document

    <wsdl:types>
                         <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:pack.TuxAll_typedef.salt11">
                                <xsd:complexType name="fml_TFML_In">
                                       <xsd:sequence>
                                              <xsd:element maxOccurs="60" minOccurs="60" name="tflong" type="xsd:long"></xsd:element>
                                              <xsd:element maxOccurs="80" minOccurs="80" name="tffloat" type="xsd:float"></xsd:element>
                                       </xsd:sequence>
                                </xsd:complexType>
                                <xsd:complexType name="fml_TFML_Out">
                                       …
    </xsd:complexType>
                         </xsd:schema>
                  </wsdl:types>

    Workaround: Use Document/literal encoded style for .Net client as recommended by Microsoft.

  • Error message regarding xsd:base64Binary in RPC/encoded style.

    If xsd:base64Binary is used in the SALT WSDL document using RPC/encoded style, wsdl.exe can generate stub code; however, the client program might report a runtime error as follows: System.InvalidOperationException:'base64Binary' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

    Workaround: This is a .Net framework issue.

    Use Document/literal encoded style for .Net client as recommended by Microsoft.