Bug 13426 - Specifying Data Contract namespace not working
Summary: Specifying Data Contract namespace not working
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-07-23 22:09 UTC by Shane van Wyk
Modified: 2013-07-23 22:09 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 13426 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Shane van Wyk 2013-07-23 22:09:17 UTC
Part or System.Runtime.Serialization.

Small Problem, When I run my ServiceStack API application on my windows machine the namespaces appear correctly as i state them to be. But when i run the service on a Linux machine off mod_mono. Then those namespaces gets overridden by something else. Please see my code below:

DTO

namespace API_ESERVICES_NOTIFICATION
{
[DataContract(Namespace = "urn:com.example:service:20130308")]
public class GetAccountNotification
{
    [DataMember]
    public GetAccountResponseTO getAccountResponse {
        get;
        set;
    }
}
}

Windows Generated SOAP11 xml

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetAccountNotification xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:com.example:service:20130308">
          <getAccountResponse xmlns:d2p1="urn:com.example:service:entity:20130308">

Linux Mod_Mono

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetAccountNotification xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API_ESERVICES_NOTIFICATION">
          <getAccountResponse xmlns:d2p1="http://schemas.datacontract.org/2004/07/API_ESERVICES_NOTIFICATION.Model">


In the DTO you can see I specified the namespace. In windows it works and it Lunux it doesn't. It is supposed to be 
urn:com.example:service:entity:20130308 and urn:com.example:service:20130308, and not http://schemas.datacontract.org/2004/07/API_ESERVICES_NOTIFICATION.Model.

I posted a question on stack overflow and have been told it is a bug in the mono framework. On windows I'm using MonoDevelop 4.0 (Xamarin Studio) and it runs of xsp4 or IIS standard 4.0. So not sure if i'm actually using mod_mono on windows machine. 

Link to StackOverdflow Question: http://stackoverflow.com/questions/17542802/servicestack-namespace-change-not-working