locked
created data type by wsdl... RRS feed

  • Question

  • Hello,

    I'm new in .NET Compact Framework and C# too but I need to build a sample app for web services.
    Here is my problem.

    1) wsdl xml schema
            <xsd:sequence>
              <xsd:element maxOccurs="unbounded" minOccurs="1" name="addresses" type="xsd:anyURI"/> ===========this one need helps.
              <xsd:element maxOccurs="1" minOccurs="0" name="senderName" type="xsd:string"/>
              <xsd:element maxOccurs="1" minOccurs="0" name="charging" type="parlayx_common_xsd:ChargingInformation"/>
              <xsd:element name="message" type="xsd:string"/>
              <xsd:element maxOccurs="1" minOccurs="0" name="receiptRequest" type="parlayx_common_xsd:SimpleReference"/>
            </xsd:sequence>

    2) generated code by wsdl compiler.

    [System.Xml.Serialization.

    XmlElementAttribute("addresses", DataType = "anyURI")]

     

    public string[] addresses

    {

     

    get

    {

     

    return this.addressesField;

    }

     

    set

    {

     

    this.addressesField = value;

    }

    }

    3) question:
    How do I fill the data for "public string[] addresses" in my code?

    Please help me.

    Thanks,
    Duk
    Friday, October 9, 2009 3:24 PM

Answers

  • Hi,

    You should be able to create an instance of the SendSMS class and then set the addresses property of this instance, as below :-

    SendSms currentSendSMS = new SendSms();
    currentSendSMS.addresses = new String[1];
    currentSendSMS.addresses[0] = "0123456789";
    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    • Marked as answer by Duk Monday, October 12, 2009 3:35 PM
    Saturday, October 10, 2009 7:53 AM

All replies

  • Hi,

    Could you create a new String[] and then assign that to the addresses property? e.g.

    addresses = new String[];
    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Friday, October 9, 2009 4:17 PM
  • Hi Paul,

    Actually generated code is:
    ========
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.
    DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.
    XmlTypeAttribute(Namespace = http://www.csapi.org/schema/parlayx/sms/send/v2_2/local)]public partial class SendSms
    {
    private string[] addressesField;
    private string senderNameField;
    private ChargingInformation chargingField;
    private string messageField;
    private SimpleReference receiptRequestField;
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("addresses", DataType = "anyURI")]
       public string[] addresses
       {
       get
       {
          return this.addressesField;
       }
       set
       {
          this.addressesField = value;
       }

       }

     

    /// <remarks/>
    public string senderName
    {
    get
    {
    return this.senderNameField;
    }
    set
    {
    this.senderNameField = value;
    }
    }
    /// <remarks/>
    public ChargingInformation charging
    {

     

    get

    {

     

    return this.chargingField;

    }

     

    set

    {

     

    this.chargingField = value;

    }

    }

     

    /// <remarks/>

     

    public string message

    {

     

    get

    {

     

    return this.messageField;

    }

     

    set

    {

     

    this.messageField = value;

    }

    }

     

    /// <remarks/>

     

    public SimpleReference receiptRequest

    {

     

    get

    {

     

    return this.receiptRequestField;

    }

     

    set

    {

     

    this.receiptRequestField = value;

    }

    }

    }


    ========
    Friday, October 9, 2009 7:14 PM
  • Hi,

    You should be able to create an instance of the SendSMS class and then set the addresses property of this instance, as below :-

    SendSms currentSendSMS = new SendSms();
    currentSendSMS.addresses = new String[1];
    currentSendSMS.addresses[0] = "0123456789";
    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    • Marked as answer by Duk Monday, October 12, 2009 3:35 PM
    Saturday, October 10, 2009 7:53 AM