none
how to set MessageContractAttribute.IsWrapped=false in Portable Class library

    Question

  • I have a portable class library. In which i have added a service reference.

    I want to remove wrapper in my soap request. but there is no property like "MessageContractAttribute.IsWrapped" in Portable Class library.. so what is the solution for it????

    Friday, October 26, 2012 12:04 PM

All replies

  • Hi Chintan,

    If you want to create a non SOAP message which just inludes the content inside the <Body> of a SOAP message, just set the MessageVersion to None.

    using(Message message=Message.CreateMessage(MessageVersioin.None,para))

    {//WriteMessage

    }

    Best Regards.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 29, 2012 9:05 AM
  • Hi Haixia Xie,

    I have added a web service reference in my project.

    In my Windows Phone Project, if i add a service reference then i am getting IsWrapped=false in automatically generated Reference.cs.

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    
    public partial class GetScheduledRequestRequest {
            
            [System.ServiceModel.MessageBodyMemberAttribute(Name="GetScheduledRequest", Namespace="urn:***.***********.com", Order=0)]
            public PCL.ServiceReference1.GetScheduledRequestRequestBody Body;
            
            public GetScheduledRequestRequest() {
            }
            
            public GetScheduledRequestRequest(PCL.ServiceReference1.GetScheduledRequestRequestBody Body) {
                this.Body = Body;
            }
        }

    But when i add a web service reference in Portable class library, i am not getting IsWrapped property in automatically generated Reference.cs

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute()]
    
    public partial class GetScheduledRequestRequest {
            
            [System.ServiceModel.MessageBodyMemberAttribute(Name="GetScheduledRequest", Namespace="urn:***.***********.com", Order=0)]
            public PCL.ServiceReference1.GetScheduledRequestRequestBody Body;
            
            public GetScheduledRequestRequest() {
            }
            
            public GetScheduledRequestRequest(PCL.ServiceReference1.GetScheduledRequestRequestBody Body) {
                this.Body = Body;
            }
        }
    

    So is there any way to remove soap request wrapper in this case??



    Tuesday, October 30, 2012 4:06 AM
  • Hi Chintan,

    Have you try the suggestion i posted above?

    Best Regards.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, October 31, 2012 2:22 AM
  • Hi Haixia

    Where we should add Message Version that you have suggested. We have added web service reference using "Add Service reference" option and VS has created Reference.cs file. So where & how to add MessageVersion ?


    Thanks, Shailesh Kanzariya

    Wednesday, December 12, 2012 7:26 AM
  • Hi Haixia Xie,

    I am not getting where should i set "MessageVesion" in automatically generated "Reference.cs"

    Wednesday, April 03, 2013 7:26 AM