Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Returning Bare Type

Reply
Thread Tools

Returning Bare Type

 
 
R. K. Wijayaratne
Guest
Posts: n/a
 
      07-17-2007
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.Enc oded,
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/

 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      07-17-2007
"R. K. Wijayaratne" <> wrote in message
news: oups.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.Enc oded,
> 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]

 
Reply With Quote
 
 
 
 
R. K. Wijayaratne
Guest
Posts: n/a
 
      07-18-2007
Hi John,

Thank you very much, that did the trick!

RKW.

"John Saunders [MVP]" wrote:

> "R. K. Wijayaratne" <> wrote in message
> news: oups.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.Enc oded,
> > 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]
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking For Bare Bones Computer Not a Hassle Keith Computer Support 4 06-02-2004 07:04 PM
Address bare disappared SA Computer Support 2 05-22-2004 09:31 PM
Procedural ["bare ASP.NET"] versus OOPy ASP.NET parley ASP .Net 13 02-11-2004 01:26 AM
bare bones <div> demo online Richard HTML 20 11-04-2003 09:38 PM
Bare LF Mark Fox ASP .Net 5 08-10-2003 10:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57