Re: Returning Bare Type
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Tue, 17 Jul 2007 10:16:06 -0400
"R. K. Wijayaratne" <rasikaw@xxxxxxxxx> wrote in message news:1184635788.918278.214410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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]
.
- Follow-Ups:
- Re: Returning Bare Type
- From: R. K. Wijayaratne
- Re: Returning Bare Type
- References:
- Returning Bare Type
- From: R. K. Wijayaratne
- Returning Bare Type
- Prev by Date: Re: First Try Failing
- Next by Date: MSDiscoCodegenerator Failure with VS2005 (used to work in VS2003)
- Previous by thread: Returning Bare Type
- Next by thread: Re: Returning Bare Type
- Index(es):
Relevant Pages
|
Loading