locked
Unable to generate temporary classes (with biztalk2006 published webservices)

    Question

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

    Monday, November 06, 2006 9:24 PM

Answers

  • 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

     

    Thursday, November 16, 2006 12:00 AM
    Moderator

All replies

  • 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

     

    Thursday, November 16, 2006 12:00 AM
    Moderator
  • I aslo got same problem. Solved with above solution. Great solution.
    Friday, February 02, 2007 11:54 AM
  • Worked great for me too. Thanks!
    Thursday, April 26, 2007 4:57 PM
  • solution worked perfectly. a real life saver

     

    Thursday, April 24, 2008 6:19 PM
  • 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
    Wednesday, July 09, 2008 10:36 PM
  • 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
    Wednesday, July 16, 2008 6:40 AM
  • 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
    Wednesday, August 06, 2008 5:10 AM
    Moderator
  • I have faced same problem while serializing the instances of the classes generated from the xsd files, which are given by the AXIS service deployers.

    Thank you very much Elena, your solution helped me a lot :)

     

    Thursday, July 15, 2010 2:53 PM
  • I struggled for a nearly a day as I was facing the  same issue with all the unbounded elements that were multi dimensional arrays. The rest of the elements even though unbounded compiled fine. The solution worked perfectly, thank you so much

    Wednesday, February 23, 2011 5:35 PM
  • nice! it worked!
    Sunday, September 23, 2012 5:18 PM