MSDN > Home page del forum > ASMX Web Services and XML Serialization > Unable to generate temporary classes (with biztalk2006 published webservices)
Formula una domandaFormula una domanda
 

Con rispostaUnable to generate temporary classes (with biztalk2006 published webservices)

  • lunedì 6 novembre 2006 21.24Sri_2009 Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

    HI

     

       I have an orchestration and schemas in biztalk 2006 which i published as an webservices. i ma able to use the orchestration  webservice in my ASP.Net code. wheni try to pass required object to that webservice method and when i try to invoke it ,i am getting  following  exception.(Scheams are Peoplesoft generated schemas from biztalk )

    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_RD_P_NID_CI_VW_sequence_RD_P_NID_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_RD_P_NID_CI_VW_sequence_RD_P_NID_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_VW_sequence_BO_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_VW_sequence_BO_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_NAME_CI_VW_sequence_BO_NAME_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_NAME_CI_VW_sequence_BO_NAME_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_ROLE_CI_VW_sequence_BO_ROLE_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_ROLE_CI_VW_sequence_BO_ROLE_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_REL_CI_VW_sequence_BO_REL_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_REL_CI_VW_sequence_BO_REL_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BC_CI_VW_sequence_BC_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BC_CI_VW_sequence_BC_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BC_SOLDTO_CI_VW_sequence_BC_SOLDTO_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BC_SOLDTO_CI_VW_sequence_BC_SOLDTO_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BC_BILLTO_CI_VW_sequence_BC_BILLTO_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BC_BILLTO_CI_VW_sequence_BC_BILLTO_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BC_SHIPTO_CI_VW_sequence_BC_SHIPTO_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BC_SHIPTO_CI_VW_sequence_BC_SHIPTO_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BC_NOTE_CI_VW_sequence_BC_NOTE_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BC_NOTE_CI_VW_sequence_BC_NOTE_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_ADDR_VW_sequence_BO_CI_ADDR_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_ADDR_VW_sequence_BO_CI_ADDR_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_PHONE_VW_sequence_BO_CI_PHONE_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_PHONE_VW_sequence_BO_CI_PHONE_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_PAGER_VW_sequence_BO_CI_PAGER_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_PAGER_VW_sequence_BO_CI_PAGER_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_EMAIL_VW_sequence_BO_CI_EMAIL_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_CI_EMAIL_VW_sequence_BO_CI_EMAIL_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_CM_USE_CI_VW_sequence_BO_CM_USE_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_CM_USE_CI_VW_sequence_BO_CM_USE_CI_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_RB_CREDIT_CD_VW_sequence_RB_CREDIT_CD_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_RB_CREDIT_CD_VW_sequence_RB_CREDIT_CD_VW'

    error CS0030: Cannot convert type 'ChangeOfAddress.XsdTypesBody.properties_BO_EMPLOY_CI_VW_sequence_BO_EMPLOY_CI_VW[]' to 'ChangeOfAddress.XsdTypesBody.properties_BO_EMPLOY_CI_VW_sequence_BO_EMPLOY_CI_VW'

     

       at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)

       at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters parameters, Assembly assembly, Hashtable assemblies)

       at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)

       at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence)

       at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)

       at System.Web.Services.Protocols.SoapServerProtocol.Initialize()

       at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

       --- End of inner exception stack trace ---

Risposte

  • giovedì 16 novembre 2006 0.00Elena KharitidiModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta

    You are running into a known problem in XmlSerializer Code Generation component: it cannot handle some cases of nested unbounded elements.  The Object Model it creates is not valid: user cannot use it to produce xml messages.

    Unfortunately to fix this you have to edit your schema to make sure that all array-like constructs will be handled properly.

     

    You would need to slightly modify all schema constructs that have the following:

    <xs:sequence maxOccurs="unbounded">

      <xs:element ../>

    <xs:sequence>

     or

    <xs:sequence>

      <xs:element maxOccurs="unbounded"/>

    <xs:sequence>

     

     

    Have to be changed to

     

    <xs:sequence maxOccurs="unbounded">

      <xs:element ../>

    <xs:sequence>

    <xs:attribute name="tmp" type="xs:string" />

    And

    <xs:sequence>

      <xs:element maxOccurs="unbounded"/>

    <xs:sequence>

    <xs:attribute name="tmp" type="xs:string" />

     

    Adding attribute will force XmlSerializer code generator using a class with array member and proper XmlSerialization attributes for the construct instead of an unwrapped array.

     

    Thanks,

    Elena

     

Tutte le risposte

  • giovedì 16 novembre 2006 0.00Elena KharitidiModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta

    You are running into a known problem in XmlSerializer Code Generation component: it cannot handle some cases of nested unbounded elements.  The Object Model it creates is not valid: user cannot use it to produce xml messages.

    Unfortunately to fix this you have to edit your schema to make sure that all array-like constructs will be handled properly.

     

    You would need to slightly modify all schema constructs that have the following:

    <xs:sequence maxOccurs="unbounded">

      <xs:element ../>

    <xs:sequence>

     or

    <xs:sequence>

      <xs:element maxOccurs="unbounded"/>

    <xs:sequence>

     

     

    Have to be changed to

     

    <xs:sequence maxOccurs="unbounded">

      <xs:element ../>

    <xs:sequence>

    <xs:attribute name="tmp" type="xs:string" />

    And

    <xs:sequence>

      <xs:element maxOccurs="unbounded"/>

    <xs:sequence>

    <xs:attribute name="tmp" type="xs:string" />

     

    Adding attribute will force XmlSerializer code generator using a class with array member and proper XmlSerialization attributes for the construct instead of an unwrapped array.

     

    Thanks,

    Elena

     

  • venerdì 2 febbraio 2007 11.54Narasimha1 Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I aslo got same problem. Solved with above solution. Great solution.
  • giovedì 26 aprile 2007 16.57hattar Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Worked great for me too. Thanks!
  • giovedì 24 aprile 2008 18.19Alan1231797 Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    solution worked perfectly. a real life saver

     

  • mercoledì 9 luglio 2008 22.36Andy Blackman Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi all,

    Has any further progress been made on this bug ? e.g. a bugfix in xsd.exe, or any cleaner workarounds ?
    I came to the same conclusion and added a "dummy" atttribute, and it all started working, but I don't want to see the dummy property in the generated code !!!!

    Any help would be most welcome...

    Thanks,

    Andy
  • mercoledì 16 luglio 2008 6.40hawilysi Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi,

    Have the same problem but I am in more deep ____, I use a standard - fi2 ( local std in sweden for building std information) so I have problems fideling with the elements. What I do now, will be gone in next release and I have to do it allover again and there are 450+schema elements  used.  Puh...

    Any plans for a new release of the XmlSerializer?

    Hilsen fra hans
  • mercoledì 6 agosto 2008 5.10John SaundersMVP, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Anyone who wants a bug fixed should file it at http://connect.microsoft.com. This forum is not a way to get bugs fixed.

    John Saunders | Use File->New Project to create Web Service Projects
  • giovedì 29 gennaio 2009 17.59TomWeiz Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
     magician ; (biblical) sorcerer, soothsayer