Hi,
I have the wsdl below, for an Axis web service, and when I select Add Web
Refernce in Visual Studio the proxy is missing a class representing the
returnedElementsType (see reference.cs below the wsdl). This complex type is
a collection of another complex type(elementType), and the Reference.cs has
an array of these rather than the single returnedElementsType. If If I want
to be able to obtain these elements from the SOAP response I have to manually
edit the Reference.cs and insert the returnedElementsType so that the proxy
matches the SOAP message from the server.
So the question is why is this class not generated, and what is there
anything I can do to ensure it is generated.
Thanks,
Richard.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:sess="http://xml.apache.org/axis/session"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:wsdl.advancedquery.ws.biors.biomax. de"
xmlns:types="urn:advancedquery.ws.biors.biomax.de"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wsdl.advancedquery.ws.biors.b iomax.de">
<wsdl:types/>
<wsdl:types/>
<wsdl:types>
<schema targetNamespace="http://xml.apache.org/axis/session"
xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType name="sessID">
<restriction base="xsd:long"/>
</simpleType>
<element name="sessionID" type="sess:sessID"/>
</schema>
<xsd:schema targetNamespace="urn:advancedquery.ws.biors.biomax .de"
xmlns="urn:advancedquery.ws.biors.biomax.de"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- Input message elements -->
<xsd:simpleType name="formatType">
<xsd:annotation>
<xsd:documentation> Enumeration type giving the possible data
formats in which entries can be retrieved from the BioRS server. FASTA -
FASTA format. ENTRY - Complete entries in source formatting.
XML_ENTRY - Complete entry in BioRS internal XML markup. XML_ELEMENTS -
Entry separated into BioRS elements, formatted in BioRS internal XML.
ELEMENTS - Entry separated into BioRS elements, no additional formatting.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="FASTA"/>
<xsd:enumeration value="ENTRY"/>
<xsd:enumeration value="XML_ENTRY"/>
<xsd:enumeration value="XML_ELEMENTS"/>
<xsd:enumeration value="ELEMENTS"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="requiredElementsType">
<xsd:annotation>
<xsd:documentation> The requiredElementsType contains a list of
the names of the elements required when ELEMENTS or XML_ELEMENTS formatType
are specified, and only a subset of all elements are required. For other
result formats, or when all elements are required null can be provided for
this parameter. </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element maxOccurs="999" minOccurs="1" name="elementName"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<!-- Return message elements -->
<xsd:complexType name="returnedElementsType">
<xsd:annotation>
<xsd:documentation> The returnedElementsType type represents a
collection ofl BioRS elements returned by a query. Each instance of this type
consists of one or more instance of elementType, each representing an
individual element. </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element maxOccurs="999" minOccurs="1" name="element"
type="elementType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="elementType">
<xsd:annotation>
<xsd:documentation> The elementType type represents an individual
BioRS element returned by a query. Each instance of this type contains the
name of the element and the element content. </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="elementName"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="elementContent"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="result">
<xsd:annotation>
<xsd:documentation> The result type contains a single result
returned by a BioRS query. Each results consists of the total number of
results for the query, the numer of this result, the databank the result is
from and either a complete result in the specified format, a collection of
elements, if the ELEMENTS result format was specified, or a message
indicating that no results matched the given query. </xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="resultNumber"
type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="totalResults"
type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="databank"
type="xsd:string"/>
<xsd:choice>
<xsd:element name="entry" type="xsd:string"/>
<xsd:element name="returnedElements" type="returnedElementsType"/>
<xsd:element name="noMatchesMessage" type="xsd:string"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- Methods signatures -->
<xsd:element name="getBiorsEntry">
<xsd:annotation>
<xsd:documentation> Required parameters: username - username
to be used to connect to the BioRS server used by the service. password
- password matching the username provided. queryString - the query in
BioRS query language. returnFormat - the format in which results should
be returned (FASTA, ENTRY, XML_ENTRY, ELEMENTS, XML_ELEMENTS).
requiredElements - an instance of type requiredElementsType containing the
names of the elements to be returned (or null). If you do not have a
username/password, set these as null to login as a guest.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" name="username" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" name="password" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="queryString"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="returnFormat"
type="formatType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="requiredElements"
type="requiredElementsType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getBiorsEntryResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="result"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getBiorsEntryResp">
<wsdl:part name="parameters" element="types:getBiorsEntryResponse"/>
</wsdl:message>
<wsdl:message name="soapHeader">
<wsdl:part name="sessID" element="sess:sessionID"/>
</wsdl:message>
<wsdl:message name="getBiorsEntryReq">
<wsdl:part name="parameters" element="types:getBiorsEntry"/>
</wsdl:message>
<wsdl:portType name="BiorsAdvancedQueryPortType">
<wsdl:operation name="getBiorsEntry">
<wsdl:input message="tns:getBiorsEntryReq"/>
<wsdl:output message="tns:getBiorsEntryResp"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BiorsAdvancedQuerySOAPBinding"
type="tns:BiorsAdvancedQueryPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getBiorsEntry">
<soap:operation soapAction="getBiorsEntry" style="document"/>
<wsdl:input>
<soap:header message="tns:soapHeader" part="sessID" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:header message="tns:soapHeader" part="sessID" use="literal"/>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BiorsAdvancedQueryService">
<wsdl:port name="BiorsAdvancedQuery"
binding="tns:BiorsAdvancedQuerySOAPBinding">
<soap:address
location="http://mips.gsf.de/ws/biorsws/services/BiorsAdvancedQuery"/>
</wsdl:port>
</wsdl:service>
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Web
Service providing the facility to query a BioRS server using the BioRS query
language. Clients invoking the service specify a query in BioRS query
language (mandatory), the result format to be returned and also optionally, a
specific list of elements to be returned (only applicable to the ELEMENTS and
XML_ELEMENTS result formats). Clients with their own username/password for
the BioRS server may provide these parameters, or if these a provided as null
a default "guest" username is used. A session is maintained between the
client and service via SOAP Header session IDs, and each invocation of an
operation of the service returns a successive entry from the set of entries
matching the given query, or a message indicating that no entries matched the
query. Each entry is returned with the number of the entry and the total
number of entries matching the query, enabling clients to determine when all
entries have been returned.</wsdl:documentation>
</wsdl:definitions>
#pragma warning disable 1591
namespace DotNet2Test.BiorsAdvRef {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="BiorsAdvancedQuerySOAPBinding", Namespace="urn:wsdl.advancedquery.ws.biors.biomax. de")]
public partial class BiorsAdvancedQueryService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {
private sessID sessionIDField;
private System.Threading.SendOrPostCallback
getBiorsEntryOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public BiorsAdvancedQueryService() {
this.Url =
global::DotNet2Test.Properties.Settings.Default.Do tNet2Test_BiorsAdvRef_BiorsAdvancedQueryService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public sessID sessionID {
get {
return this.sessionIDField;
}
set {
this.sessionIDField = value;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly ==
false))
&& (this.IsLocalFileSystemWebService(value) ==
false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event getBiorsEntryCompletedEventHandler
getBiorsEntryCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute( "sessionID",
Direction=System.Web.Services.Protocols.SoapHeader Direction.InOut)]
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("getBiorsEntry",
RequestNamespace="urn:advancedquery.ws.biors.bioma x.de",
ResponseNamespace="urn:advancedquery.ws.biors.biom ax.de",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("resu lt")]
public result
getBiorsEntry([System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified,
IsNullable=true)] string username,
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified,
IsNullable=true)] string password,
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
string queryString,
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
formatType returnFormat,
[System.Xml.Serialization.XmlArrayAttribute(Form=Sy stem.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute("el ementName",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] string[]
requiredElements) {
object[] results = this.Invoke("getBiorsEntry", new object[] {
username,
password,
queryString,
returnFormat,
requiredElements});
return ((result)(results[0]));
}
/// <remarks/>
public void getBiorsEntryAsync(string username, string password,
string queryString, formatType returnFormat, string[] requiredElements) {
this.getBiorsEntryAsync(username, password, queryString,
returnFormat, requiredElements, null);
}
/// <remarks/>
public void getBiorsEntryAsync(string username, string password,
string queryString, formatType returnFormat, string[] requiredElements,
object userState) {
if ((this.getBiorsEntryOperationCompleted == null)) {
this.getBiorsEntryOperationCompleted = new
System.Threading.SendOrPostCallback(this.OngetBior sEntryOperationCompleted);
}
this.InvokeAsync("getBiorsEntry", new object[] {
username,
password,
queryString,
returnFormat,
requiredElements},
this.getBiorsEntryOperationCompleted, userState);
}
private void OngetBiorsEntryOperationCompleted(object arg) {
if ((this.getBiorsEntryCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEvent Args
invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEve ntArgs)(arg));
this.getBiorsEntryCompleted(this, new
getBiorsEntryCompletedEventArgs(invokeArgs.Results , invokeArgs.Error,
invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost",
System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Xml",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://xml.apache.org/axis/session")]
[System.Xml.Serialization.XmlRootAttribute("session ID",
Namespace="http://xml.apache.org/axis/session", IsNullable=false)]
public partial class sessID : System.Web.Services.Protocols.SoapHeader {
private string[] textField;
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string[] Text {
get {
return this.textField;
}
set {
this.textField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Xml",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="urn:advancedquery.ws.biors.biomax.de")]
public enum formatType {
/// <remarks/>
FASTA,
/// <remarks/>
ENTRY,
/// <remarks/>
XML_ENTRY,
/// <remarks/>
XML_ELEMENTS,
/// <remarks/>
ELEMENTS,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Xml",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
public partial class result {
private int resultNumberField;
private bool resultNumberFieldSpecified;
private int totalResultsField;
private string databankField;
private object itemField;
private ItemChoiceType itemElementNameField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int resultNumber {
get {
return this.resultNumberField;
}
set {
this.resultNumberField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool resultNumberSpecified {
get {
return this.resultNumberFieldSpecified;
}
set {
this.resultNumberFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int totalResults {
get {
return this.totalResultsField;
}
set {
this.totalResultsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string databank {
get {
return this.databankField;
}
set {
this.databankField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("entr y",
typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("noMa tchesMessage",
typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("retu rnedElements",
typeof(elementType[]), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlChoiceIdentifierAttrib ute("ItemElementName")]
public object Item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public ItemChoiceType ItemElementName {
get {
return this.itemElementNameField;
}
set {
this.itemElementNameField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Xml",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="urn:advancedquery.ws.biors.biomax.de")]
public partial class elementType {
private string elementNameField;
private string elementContentField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string elementName {
get {
return this.elementNameField;
}
set {
this.elementNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string elementContent {
get {
return this.elementContentField;
}
set {
this.elementContentField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Xml",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="urn:advancedquery.ws.biors.biomax.de", IncludeInSchema=false)]
public enum ItemChoiceType {
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute(":entry" )]
entry,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute(":noMatc hesMessage")]
noMatchesMessage,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute(":return edElements")]
returnedElements,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Web.Services",
"2.0.50727.42")]
public delegate void getBiorsEntryCompletedEventHandler(object sender,
getBiorsEntryCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
public partial class getBiorsEntryCompletedEventArgs :
System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal getBiorsEntryCompletedEventArgs(object[] results,
System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public result Result {
get {
this.RaiseExceptionIfNecessary();
return ((result)(this.results[0]));
}
}
}
}
#pragma warning restore 1591