Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2005

Tip: Looking for answers? Try searching our database.

document/literal/wrapped or document/literal/bare

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Lee - 15 Nov 2005 10:22 GMT
What's the general opinion on which of these to choose?

I see that the SoapDocumentServiceAttribute defaults to literal/wrapped, but
this article -
http://msdn.microsoft.com/msdnmag/issues/05/06/ServiceStation/ - says "it
probably makes the most sense to use document/literal/bare".

In a BasicProfile1_1 compliant web service should one definitely be chosen
over the other?
Steven Cheng[MSFT] - 16 Nov 2005 01:50 GMT
Hi Phil,

Welcome.
As for the "wrapped" or "bare" parameter style for the ASP.NET webservice,
I think both of them are OK, it is something related to the ASP.NET
webservice implementation rather than the WS-I  BP or Contract-First
concept....

Actually, myself also prefer the "bared" since bared is more helpful for us
to define SOAP message's structure and format according to our custom Class
Types and XSD schemas.  e.g:

=============
[WebMethod()]
[SoapDocumentMethod(
    ParameterStyle=SoapParameterStyle.Bare
    )]
public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
    {
............
===========

==========
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
    public VariantOperationRequest()
    {
    }
           
    [XmlElement("itemType")]
    public string ItemType;
}

[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
    public VariantOperationResponse()
    {
    }
    [XmlElement("intValue",typeof(int))]
    [XmlElement("stringValue",typeof(string))]
    [XmlElement("boolValue",typeof(bool))]
    public object Item;

}
===================

While we can also define the WebMethod with  SoapParameterStyle.Wrapped and
let it output the same SOAP message format as the above "Bare" style one,
but that'll need us to specify some ASP.NET specific Attributes/ properties
such as RequestElementName, ResponseElementName, namespace.....    

So in short, if you're following the Contract First approach and want best
control on the SOAP message of your webservice(with your custom
classes...), "Bare" should be the best choice...

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
From: "Phil Lee" <phil.lee@newsgroups.nospam>
Subject: document/literal/wrapped or document/literal/bare
Date: Tue, 15 Nov 2005 10:22:32 -0000
Lines: 13
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <eRQd$5c6FHA.1020@TK2MSFTNGP15.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-84-190.range86-132.btcentralplus.com
86.132.84.190
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:12729
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

What's the general opinion on which of these to choose?

I see that the SoapDocumentServiceAttribute defaults to literal/wrapped,
but
this article -
http://msdn.microsoft.com/msdnmag/issues/05/06/ServiceStation/ - says "it
probably makes the most sense to use document/literal/bare".

In a BasicProfile1_1 compliant web service should one definitely be chosen
over the other?
Steven Cheng[MSFT] - 18 Nov 2005 13:35 GMT
Hi Phil,

Does my last reply helps a little? If there're anything else we can help,
please feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
X-Tomcat-ID: 37131942
References: <eRQd$5c6FHA.1020@TK2MSFTNGP15.phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_B051D3FF"
Content-Transfer-Encoding: 7bit
From: stcheng@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Wed, 16 Nov 2005 01:50:22 GMT
Subject: RE: document/literal/wrapped or document/literal/bare
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <c8wahAl6FHA.1240@TK2MSFTNGXA02.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 174      
Path: TK2MSFTNGXA02.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:12740
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Phil,

Welcome.
As for the "wrapped" or "bare" parameter style for the ASP.NET webservice,
I think both of them are OK, it is something related to the ASP.NET
webservice implementation rather than the WS-I  BP or Contract-First
concept....

Actually, myself also prefer the "bared" since bared is more helpful for us
to define SOAP message's structure and format according to our custom Class
Types and XSD schemas.  e.g:

=============
[WebMethod()]
[SoapDocumentMethod(
    ParameterStyle=SoapParameterStyle.Bare
    )]
public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
    {
............
===========

==========
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
    public VariantOperationRequest()
    {
    }
           
    [XmlElement("itemType")]
    public string ItemType;
}

[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
    public VariantOperationResponse()
    {
    }
    [XmlElement("intValue",typeof(int))]
    [XmlElement("stringValue",typeof(string))]
    [XmlElement("boolValue",typeof(bool))]
    public object Item;

}
===================

While we can also define the WebMethod with  SoapParameterStyle.Wrapped and
let it output the same SOAP message format as the above "Bare" style one,
but that'll need us to specify some ASP.NET specific Attributes/ properties
such as RequestElementName, ResponseElementName, namespace.....    

So in short, if you're following the Contract First approach and want best
control on the SOAP message of your webservice(with your custom
classes...), "Bare" should be the best choice...

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
From: "Phil Lee" <phil.lee@newsgroups.nospam>
Subject: document/literal/wrapped or document/literal/bare
Date: Tue, 15 Nov 2005 10:22:32 -0000
Lines: 13
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <eRQd$5c6FHA.1020@TK2MSFTNGP15.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-84-190.range86-132.btcentralplus.com
86.132.84.190
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:12729
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

What's the general opinion on which of these to choose?

I see that the SoapDocumentServiceAttribute defaults to literal/wrapped,
but
this article -
http://msdn.microsoft.com/msdnmag/issues/05/06/ServiceStation/ - says "it
probably makes the most sense to use document/literal/bare".

In a BasicProfile1_1 compliant web service should one definitely be chosen
over the other?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.