DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 16 Jul 2007 18:29:48 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.webservices        back       

Thread Index
  1    R. K. Wijayaratne
          2    John Saunders [MVP] john.saunders at trizetto.com
          3    R. K. Wijayaratne


Returning Bare Type   
Hi everyone,

We have a web method which returns the following type:


    public class methodNameResult
    {
        public string responseCode = null;
        public string details = null;
    }


Here is the web-method that returns the above:


    [SoapDocumentMethod("",
        Use = System.Web.Services.Description.SoapBindingUse.Encoded,
        ParameterStyle = SoapParameterStyle.Bare)]
    public methodNameResult OurWebMethod(...)
    {
        ...
    }


Here is what the actual returned XML from the above web-method looks
like:


    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/">
        <types:methodNameResult id="id1">
            <responseCode xsi:type="xsd:string">...</responseCode>
            <details xsi:type="xsd:string">...</details>
        </types:methodNameResult>
    </soap:Body>


How can we ensure that the returned XML doesn't have
'<types:methodNameResult id="id1">' and '</types:methodNameResult>' in
it? We would rather specify it directly at the web-service rather than
removing / modifying the XML using a SoapFilter for example.

We are using .NET FW 2.0 and WSE 3.0.

Thank you,

RKW.
http://www.codinghelper.org/
Date:Mon, 16 Jul 2007 18:29:48 -0700   Author:  

Re: Returning Bare Type   
"R. K. Wijayaratne"  wrote in message 
news:1184635788.918278.214410@i38g2000prf.googlegroups.com...

> Hi everyone,
>
> We have a web method which returns the following type:
>
>
>    public class methodNameResult
>    {
>        public string responseCode = null;
>        public string details = null;
>    }
>
>
> Here is the web-method that returns the above:
>
>
>    [SoapDocumentMethod("",
>        Use = System.Web.Services.Description.SoapBindingUse.Encoded,
>        ParameterStyle = SoapParameterStyle.Bare)]
>    public methodNameResult OurWebMethod(...)
>    {
>        ...
>    }
>
>
> Here is what the actual returned XML from the above web-method looks
> like:
>
>
>    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/
> encoding/">
>        <types:methodNameResult id="id1">
>            <responseCode xsi:type="xsd:string">...</responseCode>
>            <details xsi:type="xsd:string">...</details>
>        </types:methodNameResult>
>    </soap:Body>
>
>
> How can we ensure that the returned XML doesn't have
> '<types:methodNameResult id="id1">' and '</types:methodNameResult>' in
> it? We would rather specify it directly at the web-service rather than
> removing / modifying the XML using a SoapFilter for example.


Are you trying to get just the responseCode and details returned? If that's 
the case, then you shouldn't try to return a methodNameResult. Instead, try 
returning the two values as "out" parameters:

[WebMethod]
public void OurWebMethod(..., out string responseCode, out string details)
{
}
-- 
John Saunders [MVP]
Date:Tue, 17 Jul 2007 10:16:06 -0400   Author:  

Re: Returning Bare Type   
Hi John,

Thank you very much, that did the trick!

RKW.

"John Saunders [MVP]" wrote:


> "R. K. Wijayaratne"  wrote in message 
> news:1184635788.918278.214410@i38g2000prf.googlegroups.com...
> > Hi everyone,
> >
> > We have a web method which returns the following type:
> >
> >
> >    public class methodNameResult
> >    {
> >        public string responseCode = null;
> >        public string details = null;
> >    }
> >
> >
> > Here is the web-method that returns the above:
> >
> >
> >    [SoapDocumentMethod("",
> >        Use = System.Web.Services.Description.SoapBindingUse.Encoded,
> >        ParameterStyle = SoapParameterStyle.Bare)]
> >    public methodNameResult OurWebMethod(...)
> >    {
> >        ...
> >    }
> >
> >
> > Here is what the actual returned XML from the above web-method looks
> > like:
> >
> >
> >    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/
> > encoding/">
> >        <types:methodNameResult id="id1">
> >            <responseCode xsi:type="xsd:string">...</responseCode>
> >            <details xsi:type="xsd:string">...</details>
> >        </types:methodNameResult>
> >    </soap:Body>
> >
> >
> > How can we ensure that the returned XML doesn't have
> > '<types:methodNameResult id="id1">' and '</types:methodNameResult>' in
> > it? We would rather specify it directly at the web-service rather than
> > removing / modifying the XML using a SoapFilter for example.
> 
> Are you trying to get just the responseCode and details returned? If that's 
> the case, then you shouldn't try to return a methodNameResult. Instead, try 
> returning the two values as "out" parameters:
> 
> [WebMethod]
> public void OurWebMethod(..., out string responseCode, out string details)
> {
> }
> -- 
> John Saunders [MVP]
> 
> 
Date:Tue, 17 Jul 2007 23:46:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us