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
returnedElement sType (see reference.cs below the wsdl). This complex type is
a collection of another complex type(elementTyp e), and the Reference.cs has
an array of these rather than the single returnedElement sType. 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 returnedElement sType 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:definitio ns xmlns="http://schemas.xmlsoap .org/wsdl/"
xmlns:apachesoa p="http://xml.apache.org/xml-soap"
xmlns:sess="htt p://xml.apache.org/axis/session"
xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:tns="urn: wsdl.advancedqu ery.ws.biors.bi omax.de"
xmlns:types="ur n:advancedquery .ws.biors.bioma x.de"
xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
targetNamespace ="urn:wsdl.adva ncedquery.ws.bi ors.biomax.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:sess ID"/>
</schema>
<xsd:schema targetNamespace ="urn:advancedq uery.ws.biors.b iomax.de"
xmlns="urn:adva ncedquery.ws.bi ors.biomax.de"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<!-- Input message elements -->
<xsd:simpleTy pe name="formatTyp e">
<xsd:annotation >
<xsd:documentat ion> 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:documentati on>
</xsd:annotation>
<xsd:restrictio n base="xsd:strin g">
<xsd:enumeratio n value="FASTA"/>
<xsd:enumeratio n value="ENTRY"/>
<xsd:enumeratio n value="XML_ENTR Y"/>
<xsd:enumeratio n value="XML_ELEM ENTS"/>
<xsd:enumeratio n value="ELEMENTS "/>
</xsd:restriction >
</xsd:simpleType>
<xsd:complexTyp e name="requiredE lementsType">
<xsd:annotation >
<xsd:documentat ion> The requiredElement sType 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:documentati on>
</xsd:annotation>
<xsd:sequence >
<xsd:element maxOccurs="999" minOccurs="1" name="elementNa me"
type="xsd:strin g"/>
</xsd:sequence>
</xsd:complexType >
<!-- Return message elements -->
<xsd:complexTyp e name="returnedE lementsType">
<xsd:annotation >
<xsd:documentat ion> The returnedElement sType 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:documentati on>
</xsd:annotation>
<xsd:sequence >
<xsd:element maxOccurs="999" minOccurs="1" name="element"
type="elementTy pe"/>
</xsd:sequence>
</xsd:complexType >
<xsd:complexTyp e name="elementTy pe">
<xsd:annotation >
<xsd:documentat ion> 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:documentati on>
</xsd:annotation>
<xsd:sequence >
<xsd:element maxOccurs="1" minOccurs="1" name="elementNa me"
type="xsd:strin g"/>
<xsd:element maxOccurs="1" minOccurs="1" name="elementCo ntent"
type="xsd:strin g"/>
</xsd:sequence>
</xsd:complexType >
<xsd:element name="result">
<xsd:annotation >
<xsd:documentat ion> 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:documentati on>
</xsd:annotation>
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element maxOccurs="1" minOccurs="0" name="resultNum ber"
type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="totalResu lts"
type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="databank"
type="xsd:strin g"/>
<xsd:choice>
<xsd:element name="entry" type="xsd:strin g"/>
<xsd:element name="returnedE lements" type="returnedE lementsType"/>
<xsd:element name="noMatches Message" type="xsd:strin g"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<!-- Methods signatures -->
<xsd:element name="getBiorsE ntry">
<xsd:annotation >
<xsd:documentat ion> 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).
requiredElement s - an instance of type requiredElement sType 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:documentati on>
</xsd:annotation>
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element maxOccurs="1" name="username" nillable="true"
type="xsd:strin g"/>
<xsd:element maxOccurs="1" name="password" nillable="true"
type="xsd:strin g"/>
<xsd:element maxOccurs="1" minOccurs="1" name="queryStri ng"
type="xsd:strin g"/>
<xsd:element maxOccurs="1" minOccurs="1" name="returnFor mat"
type="formatTyp e"/>
<xsd:element maxOccurs="1" minOccurs="0" name="requiredE lements"
type="requiredE lementsType"/>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:element name="getBiorsE ntryResponse">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element ref="result"/>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getBiorsE ntryResp">
<wsdl:part name="parameter s" element="types: getBiorsEntryRe sponse"/>
</wsdl:message>
<wsdl:message name="soapHeade r">
<wsdl:part name="sessID" element="sess:s essionID"/>
</wsdl:message>
<wsdl:message name="getBiorsE ntryReq">
<wsdl:part name="parameter s" element="types: getBiorsEntry"/>
</wsdl:message>
<wsdl:portTyp e name="BiorsAdva ncedQueryPortTy pe">
<wsdl:operati on name="getBiorsE ntry">
<wsdl:input message="tns:ge tBiorsEntryReq"/>
<wsdl:output message="tns:ge tBiorsEntryResp "/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BiorsAdva ncedQuerySOAPBi nding"
type="tns:Biors AdvancedQueryPo rtType">
<soap:binding style="document "
transport="http ://schemas.xmlsoap .org/soap/http"/>
<wsdl:operati on name="getBiorsE ntry">
<soap:operati on soapAction="get BiorsEntry" style="document "/>
<wsdl:input>
<soap:header message="tns:so apHeader" part="sessID" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:header message="tns:so apHeader" part="sessID" use="literal"/>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BiorsAdva ncedQueryServic e">
<wsdl:port name="BiorsAdva ncedQuery"
binding="tns:Bi orsAdvancedQuer ySOAPBinding">
<soap:address
location="http://mips.gsf.de/ws/biorsws/services/BiorsAdvancedQu ery"/>
</wsdl:port>
</wsdl:service>
<wsdl:documenta tion xmlns:wsdl="htt p://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:documentat ion>
</wsdl:definition s>
#pragma warning disable 1591
namespace DotNet2Test.Bio rsAdvRef {
using System.Diagnost ics;
using System.Web.Serv ices;
using System.Componen tModel;
using System.Web.Serv ices.Protocols;
using System;
using System.Xml.Seri alization;
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Web.Serv ices.WebService BindingAttribut e(Name="BiorsAd vancedQuerySOAP Binding", Namespace="urn: wsdl.advancedqu ery.ws.biors.bi omax.de")]
public partial class BiorsAdvancedQu eryService :
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {
private sessID sessionIDField;
private System.Threadin g.SendOrPostCal lback
getBiorsEntryOp erationComplete d;
private bool useDefaultCrede ntialsSetExplic itly;
/// <remarks/>
public BiorsAdvancedQu eryService() {
this.Url =
global::DotNet2 Test.Properties .Settings.Defau lt.DotNet2Test_ BiorsAdvRef_Bio rsAdvancedQuery Service;
if ((this.IsLocalF ileSystemWebSer vice(this.Url) == true)) {
this.UseDefault Credentials = true;
this.useDefault CredentialsSetE xplicitly = false;
}
else {
this.useDefault CredentialsSetE xplicitly = true;
}
}
public sessID sessionID {
get {
return this.sessionIDF ield;
}
set {
this.sessionIDF ield = value;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLoca lFileSystemWebS ervice(base.Url ) == true)
&& (this.useDefaul tCredentialsSet Explicitly ==
false))
&& (this.IsLocalFi leSystemWebServ ice(value) ==
false))) {
base.UseDefault Credentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCrede ntials {
get {
return base.UseDefault Credentials;
}
set {
base.UseDefault Credentials = value;
this.useDefault CredentialsSetE xplicitly = true;
}
}
/// <remarks/>
public event getBiorsEntryCo mpletedEventHan dler
getBiorsEntryCo mpleted;
/// <remarks/>
[System.Web.Serv ices.Protocols. SoapHeaderAttri bute("sessionID ",
Direction=Syste m.Web.Services. Protocols.SoapH eaderDirection. InOut)]
[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("g etBiorsEntry",
RequestNamespac e="urn:advanced query.ws.biors. biomax.de",
ResponseNamespa ce="urn:advance dquery.ws.biors .biomax.de",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
[return: System.Xml.Seri alization.XmlEl ementAttribute( "result")]
public result
getBiorsEntry([System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied,
IsNullable=true )] string username,
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied,
IsNullable=true )] string password,
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
string queryString,
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
formatType returnFormat,
[System.Xml.Seri alization.XmlAr rayAttribute(Fo rm=System.Xml.S chema.XmlSchema Form.Unqualifie d)]
[System.Xml.Seri alization.XmlAr rayItemAttribut e("elementName" ,
Form=System.Xml .Schema.XmlSche maForm.Unqualif ied, IsNullable=fals e)] string[]
requiredElement s) {
object[] results = this.Invoke("ge tBiorsEntry", new object[] {
username,
password,
queryString,
returnFormat,
requiredElement s});
return ((result)(resul ts[0]));
}
/// <remarks/>
public void getBiorsEntryAs ync(string username, string password,
string queryString, formatType returnFormat, string[] requiredElement s) {
this.getBiorsEn tryAsync(userna me, password, queryString,
returnFormat, requiredElement s, null);
}
/// <remarks/>
public void getBiorsEntryAs ync(string username, string password,
string queryString, formatType returnFormat, string[] requiredElement s,
object userState) {
if ((this.getBiors EntryOperationC ompleted == null)) {
this.getBiorsEn tryOperationCom pleted = new
System.Threadin g.SendOrPostCal lback(this.Onge tBiorsEntryOper ationCompleted) ;
}
this.InvokeAsyn c("getBiorsEntr y", new object[] {
username,
password,
queryString,
returnFormat,
requiredElement s},
this.getBiorsEn tryOperationCom pleted, userState);
}
private void OngetBiorsEntry OperationComple ted(object arg) {
if ((this.getBiors EntryCompleted != null)) {
System.Web.Serv ices.Protocols. InvokeCompleted EventArgs
invokeArgs = ((System.Web.Se rvices.Protocol s.InvokeComplet edEventArgs)(ar g));
this.getBiorsEn tryCompleted(th is, new
getBiorsEntryCo mpletedEventArg s(invokeArgs.Re sults, invokeArgs.Erro r,
invokeArgs.Canc elled, invokeArgs.User State));
}
}
/// <remarks/>
public new void CancelAsync(obj ect userState) {
base.CancelAsyn c(userState);
}
private bool IsLocalFileSyst emWebService(st ring 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.StringCo mparison.Ordina lIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Xml ",
"2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="http://xml.apache.org/axis/session")]
[System.Xml.Seri alization.XmlRo otAttribute("se ssionID",
Namespace="http ://xml.apache.org/axis/session", IsNullable=fals e)]
public partial class sessID : System.Web.Serv ices.Protocols. SoapHeader {
private string[] textField;
/// <remarks/>
[System.Xml.Seri alization.XmlTe xtAttribute()]
public string[] Text {
get {
return this.textField;
}
set {
this.textField = value;
}
}
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Xml ",
"2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="urn:adv ancedquery.ws.b iors.biomax.de" )]
public enum formatType {
/// <remarks/>
FASTA,
/// <remarks/>
ENTRY,
/// <remarks/>
XML_ENTRY,
/// <remarks/>
XML_ELEMENTS,
/// <remarks/>
ELEMENTS,
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Xml ",
"2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.XmlTy peAttribute(Ano nymousType=true )]
public partial class result {
private int resultNumberFie ld;
private bool resultNumberFie ldSpecified;
private int totalResultsFie ld;
private string databankField;
private object itemField;
private ItemChoiceType itemElementName Field;
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public int resultNumber {
get {
return this.resultNumb erField;
}
set {
this.resultNumb erField = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlIg noreAttribute()]
public bool resultNumberSpe cified {
get {
return this.resultNumb erFieldSpecifie d;
}
set {
this.resultNumb erFieldSpecifie d = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public int totalResults {
get {
return this.totalResul tsField;
}
set {
this.totalResul tsField = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string databank {
get {
return this.databankFi eld;
}
set {
this.databankFi eld = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "entry",
typeof(string), Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
[System.Xml.Seri alization.XmlEl ementAttribute( "noMatchesMessa ge",
typeof(string), Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
[System.Xml.Seri alization.XmlEl ementAttribute( "returnedElemen ts",
typeof(elementT ype[]), Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
[System.Xml.Seri alization.XmlCh oiceIdentifierA ttribute("ItemE lementName")]
public object Item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlIg noreAttribute()]
public ItemChoiceType ItemElementName {
get {
return this.itemElemen tNameField;
}
set {
this.itemElemen tNameField = value;
}
}
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Xml ",
"2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="urn:adv ancedquery.ws.b iors.biomax.de" )]
public partial class elementType {
private string elementNameFiel d;
private string elementContentF ield;
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string elementName {
get {
return this.elementNam eField;
}
set {
this.elementNam eField = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string elementContent {
get {
return this.elementCon tentField;
}
set {
this.elementCon tentField = value;
}
}
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Xml ",
"2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="urn:adv ancedquery.ws.b iors.biomax.de" , IncludeInSchema =false)]
public enum ItemChoiceType {
/// <remarks/>
[System.Xml.Seri alization.XmlEn umAttribute(":e ntry")]
entry,
/// <remarks/>
[System.Xml.Seri alization.XmlEn umAttribute(":n oMatchesMessage ")]
noMatchesMessag e,
/// <remarks/>
[System.Xml.Seri alization.XmlEn umAttribute(":r eturnedElements ")]
returnedElement s,
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]
public delegate void getBiorsEntryCo mpletedEventHan dler(object sender,
getBiorsEntryCo mpletedEventArg s e);
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
public partial class getBiorsEntryCo mpletedEventArg s :
System.Componen tModel.AsyncCom pletedEventArgs {
private object[] results;
internal getBiorsEntryCo mpletedEventArg s(object[] results,
System.Exceptio n exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public result Result {
get {
this.RaiseExcep tionIfNecessary ();
return ((result)(this. results[0]));
}
}
}
}
#pragma warning restore 1591