0

I create a service reference in VS by right clicking "Service References" and entering a URL that contains the wsdl.

It kind of works but the property AddRobinsonEntryRequest.subscriberEmails is created as string. It should be an array of type EmailAddress.

I validated the wsdl with XMLSpy and it is stated to be valid.

If I open the same file in VS I get the error: type http://backclick.de/rpc/soap/schemas/types/types:ListOfEmailAddress is not defined.

on line 9.

Here the wsdl:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch0="http://backclick.de/rpc/soap/schemas/messages" xmlns:sch1="http://backclick.de/rpc/soap/schemas/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://backclick.de/rpc/soap/schemas/types" targetNamespace="http://backclick.de/rpc/soap/schemas/types">
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://backclick.de/rpc/soap/schemas/messages" xmlns:types="http://backclick.de/rpc/soap/schemas/types" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://backclick.de/rpc/soap/schemas/messages">
            <import namespace="http://backclick.de/rpc/soap/schemas/types"/>
            <element name="AddRobinsonEntryRequest">
                <complexType>
                    <all>
                        <element name="subscriberEmails" type="types:ListOfEmailAddress"/>
                    </all>
                </complexType>
            </element>
            <element name="AddRobinsonEntryResponse">
                <complexType>
                    <sequence>
                        <element name="success" type="boolean"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://backclick.de/rpc/soap/schemas/types">
            <simpleType name="ListOfEmailAddress">
                <list itemType="tns:EmailAddress"/>
            </simpleType>
            <simpleType name="EmailAddress">
                <restriction base="string">
                    <pattern value="[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?"/>
                </restriction>
            </simpleType>
        </schema>
    </wsdl:types>
    <wsdl:message name="AddRobinsonEntryResponse">
        <wsdl:part name="AddRobinsonEntryResponse" element="sch0:AddRobinsonEntryResponse"/>
    </wsdl:message>
    <wsdl:message name="AddRobinsonEntryRequest">
        <wsdl:part name="AddRobinsonEntryRequest" element="sch0:AddRobinsonEntryRequest"/>
    </wsdl:message>
    <wsdl:portType name="BackclickService">
        <wsdl:operation name="AddRobinsonEntry">
            <wsdl:input name="AddRobinsonEntryRequest" message="sch1:AddRobinsonEntryRequest"/>
            <wsdl:output name="AddRobinsonEntryResponse" message="sch1:AddRobinsonEntryResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="BackclickServiceSoap11" type="tns:BackclickService">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="AddRobinsonEntry">
            <soap:operation soapAction=""/>
            <wsdl:input name="AddRobinsonEntryRequest">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="AddRobinsonEntryResponse">
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="BackclickServiceService">
        <wsdl:port name="BackclickServiceSoap11" binding="tns:BackclickServiceSoap11">
            <soap:address location="http://asp.backclick.de:80/bc/rpc/soap"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

This is the resulting proxyclass:

  public partial class AddRobinsonEntryRequest : object, System.ComponentModel.INotifyPropertyChanged {

        private string subscriberEmailsField;

        /// <remarks/>
        public string subscriberEmails {
            get {
                return this.subscriberEmailsField;
            }
            set {
                this.subscriberEmailsField = value;
                this.RaisePropertyChanged("subscriberEmails");
            }
        }

What do I have to do to get subscriberEmailsField generated as an array?

Mathias F
  • 15,906
  • 22
  • 89
  • 159

1 Answers1

0

I misread the wsdl. subscriberEmails realy expects a string. ListOfEmailAddress is not an array, but a string in the format "mail1@domain.com mail1@domain.com mail2@domain.com"

Mathias F
  • 15,906
  • 22
  • 89
  • 159