Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support complex types with inheritance from different namespace #232

Closed
agpreynolds opened this issue Mar 22, 2019 · 0 comments
Closed

Support complex types with inheritance from different namespace #232

agpreynolds opened this issue Mar 22, 2019 · 0 comments

Comments

@agpreynolds
Copy link
Contributor

Given the following service setup:

namespace CoreService
{
    using System.ServiceModel;
    using Other;

    [ServiceContract]
    public interface ITestService
    {
        [OperationContract]
        Child GetChild(int id);
    }

    public class TestService : ITestService
    {
        public Child GetChild(int id)
        {
            return new Child();
        }
    }

    public class Child : Parent
    {
        public string Name { get; set; }
    }

}

namespace Other
{
    public class Parent
    {
        public int Id { get; set; }
    }
}

The current setup produces the following WSDL markup:

<xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="Child">
<xs:complexContent>
<xs:extension base="Parent">
<xs:sequence>
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

We should aim for the following:

<xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="Child">
<xs:complexContent>
<xs:extension xmlns:q1="http://schemas.datacontract.org/2004/07/Other" base="q1:Parent">
<xs:sequence>
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

I will be raising a PR to address this imminently

kotovaleksandr added a commit that referenced this issue Mar 22, 2019
Fix #232 - support base types from different namespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant