Web Services Quiz: Issue 8 - the Answer
The number one problem in dealing with rpc-literal Web Services is the fact that they are unsupported on the .NET platform, yet. However, every rpc-literal message can be “built” using a doc-literal based implementations. By doing so, the .NET stub for the WSDL defined in Issue 8 may look the following:
[WebServiceBinding(Name="CalculatorSoap", Namespace="uri.test.com")]
public abstract class Issue7Service : System.Web.Services.WebService
{
[WebMethod]
[SoapDocumentMethod("uri.test.com/add",
Use=SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElement("AddResponse", Namespace="uri.test.com")]
public abstract AddResponse Add([XmlElement("Add", Namespace="uri.test.com")] Add addRequest);
}
[XmlType(Namespace="uri.test.com")]
public class Add
{
public AddRequestType AddRequestType;
}
[XmlType(Namespace="uri.test.com")]
public class AddRequestType
{
public int a;
public int b;
}
[XmlType(Namespace="uri.test.com")]
public class AddResponseType
{
public int c;
}
[XmlType(Namespace="uri.test.com")]
public class AddResponse
{
public AddResponseType AddResponseType;
}
The full explanation of this answer has been split into 3 different postings:
- Step 1: What is rpc-literal anyway?
- Step 2: How can I implement an rpc-literal contract using .NET?
- Step 3: What's wrong with rpc-literal?
Comments
- Anonymous
February 02, 2006
The comment has been removed