none
Issue consuming Webservice that has restricted complex type through .net RRS feed

  • Question

  • Issue description :

     

    We are trying to consume a service that is exposed by TIBCO in SOAP format, we are facing issues during transforming a restricted complex type object it into .net object.  We are able to receive the SOAP packet, but its failing to deserialize it into the valid c# object.  However the object was instantiated but without any value (values were null). The response status is success, but the translation of the object is failing. Below is the WSDL snippet for the reference. Apart from building a custom deserialzer is there any other better approach for this problem?

     

    <xs:complexType name="GetIndividualByCIMIdResponseType">

                    <xs:annotation>

                        <xs:documentation xml:lang="en">

                                                    This response provides a list of application system parties which are source system identifiers for the requested CIM Identifier, and response contextual information (Success flag and optional Exception Details).

                                        </xs:documentation>

                    </xs:annotation>

                    <xs:complexContent>

                        <xs:extension base="cst:SimpleResponse">

                            <xs:sequence>

                                <xs:element name="Individual" type="ns0:IndividualRestrictedType" minOccurs="0"/>

                            </xs:sequence>

                        </xs:extension>

                    </xs:complexContent>

                </xs:complexType>

              <xs:complexType name="IndividualRestrictedType">

                    <xs:complexContent>

                        <xs:restriction base="ns0:IndividualType">

                            <xs:sequence>

                                <xs:element name="DoNotMerge" type="ns0:DoNotMergeType" minOccurs="0"/>

                                <xs:element name="PartyIdentifier" type="ns0:CIMIdentifierType" minOccurs="0"/>

                                <xs:element name="EmailAccountList" type="ns0:EmailAccountListType" minOccurs="0"/>

                                <xs:element name="TelephoneServiceList" type="ns0:TelephoneServiceListType" minOccurs="0"/>

                                <xs:element name="AddressList" type="ns0:AddressListType" minOccurs="0"/>

                                <xs:element name="DateOfBirth" type="ns0:DateOfBirthType" minOccurs="0"/>

                                <xs:element name="FamilyName" type="ns0:FamiltyNameType" minOccurs="0"/>

                                <xs:element name="FirstName" type="ns0:FirstNameType" minOccurs="0"/>

                                <xs:element name="Initials" type="ns0:InitialsType" minOccurs="0"/>

                                <xs:element name="MiddleNames" type="ns0:MiddleNamesType" minOccurs="0"/>

                                <xs:element name="PreferredName" type="ns0:PreferredNameType" minOccurs="0"/>

                                <xs:element name="Sex" type="ns0:SexType" minOccurs="0"/>

                                <xs:element name="Title" type="ns0:TitleType" minOccurs="0"/>

                                <xs:element name="YearOfBirth" type="ns0:YearOfBirthType" minOccurs="0"/>

                            </xs:sequence>

                        </xs:restriction>

                    </xs:complexContent>

                </xs:complexType>

     

     

    Sunday, May 17, 2015 2:06 AM

All replies

  • We are trying to consume a service that is exposed by TIBCO in SOAP format, we are facing issues during transforming a restricted complex type object it into .net object.  We are able to receive the SOAP packet, but its failing to deserialize it into the valid c# object.  However the object was instantiated but without any value (values were null). The response status is success, but the translation of the object is failing. Below is the WSDL snippet for the reference. Apart from building a custom deserialzer is there any other better approach for this problem :

    <xs:complexType name="GetIndividualByCIMIdResponseType">

                    <xs:annotation>

                        <xs:documentation xml:lang="en">

                                                    This response provides a list of application system parties which are source system identifiers for the requested CIM Identifier, and response contextual information (Success flag and optional Exception Details).

                                        </xs:documentation>

                    </xs:annotation>

                    <xs:complexContent>

                        <xs:extension base="cst:SimpleResponse">

                            <xs:sequence>

                                <xs:element name="Individual" type="ns0:IndividualRestrictedType" minOccurs="0"/>

                            </xs:sequence>

                        </xs:extension>

                    </xs:complexContent>

                </xs:complexType>

              <xs:complexType name="IndividualRestrictedType">

                    <xs:complexContent>

                        <xs:restriction base="ns0:IndividualType">

                            <xs:sequence>

                                <xs:element name="DoNotMerge" type="ns0:DoNotMergeType" minOccurs="0"/>

                                <xs:element name="PartyIdentifier" type="ns0:CIMIdentifierType" minOccurs="0"/>

                                <xs:element name="EmailAccountList" type="ns0:EmailAccountListType" minOccurs="0"/>

                                <xs:element name="TelephoneServiceList" type="ns0:TelephoneServiceListType" minOccurs="0"/>

                                <xs:element name="AddressList" type="ns0:AddressListType" minOccurs="0"/>

                                <xs:element name="DateOfBirth" type="ns0:DateOfBirthType" minOccurs="0"/>

                                <xs:element name="FamilyName" type="ns0:FamiltyNameType" minOccurs="0"/>

                                <xs:element name="FirstName" type="ns0:FirstNameType" minOccurs="0"/>

                                <xs:element name="Initials" type="ns0:InitialsType" minOccurs="0"/>

                                <xs:element name="MiddleNames" type="ns0:MiddleNamesType" minOccurs="0"/>

                                <xs:element name="PreferredName" type="ns0:PreferredNameType" minOccurs="0"/>

                                <xs:element name="Sex" type="ns0:SexType" minOccurs="0"/>

                                <xs:element name="Title" type="ns0:TitleType" minOccurs="0"/>

                                <xs:element name="YearOfBirth" type="ns0:YearOfBirthType" minOccurs="0"/>

                            </xs:sequence>

                        </xs:restriction>

                    </xs:complexContent>

                </xs:complexType>


    Friday, May 15, 2015 11:21 PM
  • Hi Abhishek,
      According to this case ,I have shared the corresponding details below :
           For a complex type, While restriction has limited binding support, it is fully represented in the Schema Object Model. There is the XmlSchemaSimpleTypeRestriction class for simple type restriction, and there are the XmlSchemaComplexContentRestriction and XmlSchemaSimpleContentRestriction classes for both kinds of complex type restriction. Furthermore, XmlSchemaSimpleTypeRestriction and XmlSchemaSimpleContentRestriction both have a Facets property that can hold objects representing any of the children of simpleType/restriction or simpleContent/restriction.

    The type of xs:element should be type=“ns0:IndividualType” instead of type="ns0:IndividualRestrictedType" ,it may not return null value.
    so you can modify your WSDL like below :

    <xs:extension base="cst:SimpleResponse">
     <xs:sequence>
       <xs:element name="Individual" type="ns0:IndividualType" 
    minOccurs="0"/> </xs:sequence> </xs:extension>

    for more information, you can refer the complex Type element binding support  :
    https://msdn.microsoft.com/en-us/library/vstudio/k6e7dbk9(v=vs.100).aspx

    Monday, May 18, 2015 9:36 AM
  • For a complex type, While restriction has limited binding support, it is fully represented in the Schema Object Model. There is the XmlSchemaSimpleTypeRestriction class for simple type restriction, and there are the XmlSchemaComplexContentRestriction and XmlSchemaSimpleContentRestriction classes for both kinds of complex type restriction. Furthermore, XmlSchemaSimpleTypeRestriction and XmlSchemaSimpleContentRestriction both have a Facets property that can hold objects representing any of the children of simpleType/restriction or simpleContent/restriction.

    The type of xs:element should be type=“ns0:IndividualType” instead of type="ns0:IndividualRestrictedType" ,it may not return null value.
    so you can modify your WSDL like below :

    <xs:extension base="cst:SimpleResponse">
     <xs:sequence>
       <xs:element name="Individual" type="ns0:IndividualType" 
    minOccurs="0"/> </xs:sequence> </xs:extension>

    for more information, you can refer the complex Type element binding support  :
    https://msdn.microsoft.com/en-us/library/vstudio/k6e7dbk9(v=vs.100).aspx

    Monday, May 18, 2015 10:04 AM
  • We changed "ns0:IndividualRestrictedType" to "ns0:IndividualType" still the properties are null. Do you have any suggestion from Webservice end that needs to be changed so that we can easily consume it in the .net

    Nagendrababu

    Wednesday, May 20, 2015 3:00 AM
  • Thanks Edwin.
    Thursday, May 21, 2015 12:20 AM
  • We tried this but we have the same behavior even after changing the tags.
    Thursday, May 21, 2015 12:21 AM
  • Is there any third party tool to generate proxy class?
    Thursday, May 21, 2015 12:22 AM