MSDN > 論壇首頁 > ASMX Web Services and XML Serialization > Unable to generate temporary classes (with biztalk2006 published webservices)
發問發問
 

已答覆Unable to generate temporary classes (with biztalk2006 published webservices)

  • 2006年11月6日 下午 09:24Sri_2009 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    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 ---

解答

  • 2006年11月16日 上午 12:00Elena Kharitidi版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆

    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

     

所有回覆

  • 2006年11月16日 上午 12:00Elena Kharitidi版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆

    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

     

  • 2007年2月2日 上午 11:54Narasimha1 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I aslo got same problem. Solved with above solution. Great solution.
  • 2007年4月26日 下午 04:57hattar 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Worked great for me too. Thanks!
  • 2008年4月24日 下午 06:19Alan1231797 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    solution worked perfectly. a real life saver

     

  • 2008年7月9日 下午 10:36Andy Blackman 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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
  • 2008年7月16日 上午 06:40hawilysi 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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
  • 2008年8月6日 上午 05:10John SaundersMVP, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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
  • 2009年1月29日 下午 05:59TomWeiz 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
     magician ; (biblical) sorcerer, soothsayer