[Mono-devel-list] error generating .wsdl - duplicated ArrayOfString ??

Javier Ramon Garcia javier at uh.cu
Tue Apr 13 16:41:23 EDT 2004


Hi,

I'll appreciate any help to solve or workaround this problem with wsdl 
generation.

I am implementing with xsp/mod_mono a very simple xml web service. It was  
running ok until I add a new method(TranslateBatch) which return an string[]

It seems that the disco tool included with mono-0.31 (for Fedora) is 
generating a duplicated block for the ArrayOfString type in the 
gererated .wsdl. So when a run wsdl to generate my proxy class i get an error
like:

Mono Web Services Description Language Utility
Error: System.Xml.Schema.XmlSchemaException: XmlSchema error: Named item 
http://tempuri.org/:ArrayOfString was already contained in the schema object 
table. Related schema item SourceUri: , Line 33, Position 7.
in <0x000c1> System.Xml.Schema.ValidationHandler:RaiseValidationEvent 
(System.Xml.Schema.ValidationEventHandler,System.Exception,string,System.Xml.Schema.XmlSchemaObject,object,string,System.Xml.Schema.XmlSeverityType)
in <0x00020> System.Xml.Schema.XmlSchemaObject:error 
(System.Xml.Schema.ValidationEventHandler,string,System.Exception,System.Xml.Schema.XmlSchemaObject,object)
in <0x00033> System.Xml.Schema.XmlSchemaObject:error 
(System.Xml.Schema.ValidationEventHandler,string)
in <0x001a4> System.Xml.Schema.XmlSchemaUtil:AddToTable 
(System.Xml.Schema.XmlSchemaObjectTable,System.Xml.Schema.XmlSchemaObject,System.Xml.XmlQualifiedName,System.Xml.Schema.ValidationEventHandler)
in <0x01e95> System.Xml.Schema.XmlSchema:Compile 
(System.Xml.Schema.ValidationEventHandler,System.Collections.Stack,System.Xml.Schema.XmlSchema,System.Xml.Schema.XmlSchemaCollection,System.Xml.XmlResolver)
in <0x00048> System.Xml.Schema.XmlSchema:Compile 
(System.Xml.Schema.ValidationEventHandler,System.Xml.XmlResolver)

If i remove manually the duplicated block the .cs file is generated 
successfully, but I get the same error anyway when testing or using the 
service through the web.

I´ve attached the mono version of the .wsdl and the vs.net version of the 
same .wsdl

The following is an extract of my webservice source code:

...

[WebMethod]
public string Translate( string code, string language )
{ ... }				

public string[] TranslateBatch( string[] codes, string language )
{ 
  // before adding this method everything worked OK 
}
				
public StringCollection AvailableLanguages( bool with_translations_only )
{ ... }
	
...							

THANKS 
-J
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TranslationService.dup.wsdl
Type: application/octet-stream
Size: 20260 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040413/c148d374/attachment.obj 
-------------- next part --------------
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:element name="Translate">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="TranslateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="TranslateResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="TranslateBatch">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="codes" type="s0:ArrayOfString" />
            <s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="ArrayOfString">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:element name="TranslateBatchResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="TranslateBatchResult" type="s0:ArrayOfString" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="AvailableLanguages">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="with_translations_only" type="s:boolean" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="AvailableLanguagesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="AvailableLanguagesResult" type="s0:ArrayOfString" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="DefaultLanguage">
        <s:complexType />
      </s:element>
      <s:element name="DefaultLanguageResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="DefaultLanguageResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="HasTranslations">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="HasTranslationsResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="HasTranslationsResult" type="s:boolean" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="UntranslatedLanguageName">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="UntranslatedLanguageNameResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="UntranslatedLanguageNameResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </types>
  <message name="TranslateSoapIn">
    <part name="parameters" element="s0:Translate" />
  </message>
  <message name="TranslateSoapOut">
    <part name="parameters" element="s0:TranslateResponse" />
  </message>
  <message name="TranslateBatchSoapIn">
    <part name="parameters" element="s0:TranslateBatch" />
  </message>
  <message name="TranslateBatchSoapOut">
    <part name="parameters" element="s0:TranslateBatchResponse" />
  </message>
  <message name="AvailableLanguagesSoapIn">
    <part name="parameters" element="s0:AvailableLanguages" />
  </message>
  <message name="AvailableLanguagesSoapOut">
    <part name="parameters" element="s0:AvailableLanguagesResponse" />
  </message>
  <message name="DefaultLanguageSoapIn">
    <part name="parameters" element="s0:DefaultLanguage" />
  </message>
  <message name="DefaultLanguageSoapOut">
    <part name="parameters" element="s0:DefaultLanguageResponse" />
  </message>
  <message name="HasTranslationsSoapIn">
    <part name="parameters" element="s0:HasTranslations" />
  </message>
  <message name="HasTranslationsSoapOut">
    <part name="parameters" element="s0:HasTranslationsResponse" />
  </message>
  <message name="UntranslatedLanguageNameSoapIn">
    <part name="parameters" element="s0:UntranslatedLanguageName" />
  </message>
  <message name="UntranslatedLanguageNameSoapOut">
    <part name="parameters" element="s0:UntranslatedLanguageNameResponse" />
  </message>
  <portType name="TranslationServiceSoap">
    <operation name="Translate">
      <documentation>Returns the translation of a message code to the specified language.</documentation>
      <input message="s0:TranslateSoapIn" />
      <output message="s0:TranslateSoapOut" />
    </operation>
    <operation name="TranslateBatch">
      <documentation>Returns the translation of each message code to the specified language.</documentation>
      <input message="s0:TranslateBatchSoapIn" />
      <output message="s0:TranslateBatchSoapOut" />
    </operation>
    <operation name="AvailableLanguages">
      <documentation>Returns the codes list of available languages. Pass true as argument if you want only languages with translations available.</documentation>
      <input message="s0:AvailableLanguagesSoapIn" />
      <output message="s0:AvailableLanguagesSoapOut" />
    </operation>
    <operation name="DefaultLanguage">
      <documentation>Returns the default language code.</documentation>
      <input message="s0:DefaultLanguageSoapIn" />
      <output message="s0:DefaultLanguageSoapOut" />
    </operation>
    <operation name="HasTranslations">
      <documentation>Returns true if there are translations available for the specified language code.</documentation>
      <input message="s0:HasTranslationsSoapIn" />
      <output message="s0:HasTranslationsSoapOut" />
    </operation>
    <operation name="UntranslatedLanguageName">
      <documentation>Returns the message code of the specified language code.</documentation>
      <input message="s0:UntranslatedLanguageNameSoapIn" />
      <output message="s0:UntranslatedLanguageNameSoapOut" />
    </operation>
  </portType>
  <binding name="TranslationServiceSoap" type="s0:TranslationServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <operation name="Translate">
      <soap:operation soapAction="http://tempuri.org/Translate" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="TranslateBatch">
      <soap:operation soapAction="http://tempuri.org/TranslateBatch" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="AvailableLanguages">
      <soap:operation soapAction="http://tempuri.org/AvailableLanguages" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="DefaultLanguage">
      <soap:operation soapAction="http://tempuri.org/DefaultLanguage" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="HasTranslations">
      <soap:operation soapAction="http://tempuri.org/HasTranslations" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="UntranslatedLanguageName">
      <soap:operation soapAction="http://tempuri.org/UntranslatedLanguageName" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>
  <service name="TranslationService">
    <documentation>This service is intended for translating texts shown in multilingual clients. Most of the methods in this service receive a language code (es, en, ru, ...) and/or a message code ( wbl-03, ebl-01, ...)</documentation>
    <port name="TranslationServiceSoap" binding="s0:TranslationServiceSoap">
      <soap:address location="http://localhost/WebService2/TranslationService.asmx" />
    </port>
  </service>
</definitions>


More information about the Mono-devel-list mailing list