Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:55:10+00:00 2026-06-17T13:55:10+00:00

I have a WCF method which currently returns a string like so: string CreateDesign(string

  • 0

I have a WCF method which currently returns a string like so:

string CreateDesign(string UID, string TemplateName)

The retruned string is created by this method:

string RequestProcessed(string status, string UID)
    {
        XDocument doc = new XDocument(
            new XElement("RequestProcessed",
                new XElement("Status", status),
                new XElement("UID", UID)));

        return doc.ToString();
    }

The response that I got from using SOAPUI is like this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
  <CreateDesignResponse xmlns="http://tempuri.org/">
     <CreateDesignResult><![CDATA[<RequestProcessed>
       <Status>OK</Status>
       <UID>FolderName</UID>
     </RequestProcessed>]]></CreateStandardResult>
  </CreateStandardResponse>
 </s:Body>
 </s:Envelope>

The client is expecting it like this:

<soap:Body>
 <m:RequestProcessed xmlns:m=" ">
  <m:Status></m:Status>
  <m:UID></m:UID>
 </m: RequestProcessed >
</soap:Body>

What should I do to make the WCF service return the response like that?
I am struggling with this for quite sometime now, appreciate any help.

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:55:12+00:00Added an answer on June 17, 2026 at 1:55 pm

    To have full controll over your SOAP message body you should use MessageContract attribute for both your input and output parameters. Here is a good article on the web to start with.
    Using Message Contracts
    Hope it helps!

    EDITED:
    Operation contract

    [ServiceContract]
    public interface ITestService
    {
        [OperationContract]
        RequestProcessed TestMethod(RequestInput tt);
    }
    

    RequestProcessed

    [MessageContract]
    public class RequestProcessed
    {
        [MessageBodyMember]
        public string Status { get; set; }
        [MessageBodyMember]
        public Guid UID { get; set; }
    }
    

    SOAP message body

    <s:Body>
       <RequestProcessed xmlns="http://tempuri.org/">
         <Status>OK</Status>
         <UID>ffd338ed-bca3-46c1-9ee3-3c92ba3b3acc</UID>
       </RequestProcessed>
    </s:Body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method on a WCF proxy which returns void. If the return
I have a wcf service defined like this: [OperationContract] [WebInvoke(Method = POST, ResponseFormat =
Following this post I have created a WCF client which: Uses ADFS to authenticate
I have a WCF service, this is a method which I'd to call: [OperationContract]
I have a simple WCF service which has a method that returns a complex
Let's say I have a WCF service which has a method returning object Person.
Hi I want to create a WCF service that have login method, which is
I have a WCF service and one of the method returns Stream. Now the
we have a C#-Server which runs a WCF-Service. Currently we're implementing some (DataContract)-classes. Now
I have a WCF Service which is currently in Production. The code performance are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.