Previous Topic: Visual Basic and C# Wrapper Client Proxy ClassesNext Topic: Calling Web Services Operations


Preparing Visual Studio Solution

If you decide to create .NET project from scratch alternatively, you have to start with generating a new Service Reference using Visual Studio Add Service. It requires a couple of modifications in the generated code also.

Follow these steps:

  1. Select Add Service Reference in the Visual Studio and enter a valid address pointing to the WSDL file.
  2. Complete the steps in the wizard.

    The generated reference can be found under the Service References node in the Visual Studio.

  3. Open the App.config or Web.config file and add the following attributes for binding:
    messageEncoding="Mtom"
    
    maxReceivedMessageSize="<size in bytes>"
    
    maxBufferSize="<size in bytes>".
    
    Example:
    
    <binding name="OmWebServiceServicePortSoapBinding" messageEncoding="Mtom" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
    
  4. Open the generated class Reference.cs, click the generated Service Reference and open the Object browser and then go to the OmVector class.
  5. Replace the private string[][] arrayField with private OmStringArray[] arrayField.
  6. Replace public string[][] array with public OmStringArray[] array.
  7. Delete all the attributes earlier to public OmStringArray[] array property and insert the following attributes there:
    [System.Xml.Serialization.XmlElementAttribute(("array", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 0)]
    

    Note: Follow the steps from 4 to 7 whenever the Service Reference is updated.