1
[ServiceContract]
    public interface IEventDismiss
    {
        [OperationContract]
        [return:MessageParameter(Name="response")]
        [XmlSerializerFormat]
        Response EventDismissRequest(Request request);
    }

[DataContract(Namespace = "")]
[Serializable]
public sealed class Request
{
    [DataMember]
    public string EventID { get; set; }
}

Above is my definition of the WCF service I'm trying to run, with the above I would get the following request structure in my SOAPUI

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
  <tem:EventDismissRequest>
     <!--Optional:-->
     <tem:request>
        <!--Optional:-->
        <tem:EventID>?</tem:EventID>
     </tem:request>
  </tem:EventDismissRequest>
 </soapenv:Body>
</soapenv:Envelope>

Is there a way I can get rid of the namespace tem under request and EventID but leave it on EventDismissRequest? so that my reqeuest data structure would look something like below:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
  <tem:EventDismissRequest>
     <request>
        <EventID>?</EventID>
     </request>
  </tem:EventDismissRequest>
 </soapenv:Body>
</soapenv:Envelope>
3
  • 1
    You should be able to accomplish what you want in a manner similar to this answer: stackoverflow.com/a/7507206/77074 Can I ask why you want to do this? Commented Mar 28, 2014 at 19:45
  • Thanks Oren, I'll look at that. One of the client we have requested this...I know, I would not do this to myself. Commented Mar 28, 2014 at 19:55
  • 1
    I found this blog article called Changing prefixes in XML responses for WCF services, maybe it will help you: blogs.msdn.com/b/carlosfigueira/archive/2010/06/13/… Commented Mar 29, 2014 at 23:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.