Web サービス コード (ASP.NET 2.0):
[WebMethod]
[return: XmlElement("TestMe")]
public string TestMe(int value)
{
return value.ToString();
}
は、次の応答を返します。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<TestMeResponse xmlns="http://example.org/WebServiceTest">
<TestMe>7499</TestMe>
</TestMeResponse>
</soap:Body>
</soap:Envelope>
これを XML ファイルとして保存し、Liquid XML Studioで開いて検証しようとすると、次のエラー メッセージが表示されます。
Could not find schema information for the element 'http://example.org/WebServiceTest:TestMeResponse'.
Could not find schema information for the element 'http://example.org/WebServiceTest:TestMe'
では、これが正しく検証されるように正しい名前空間やスキーマを追加するにはどうすればよいですか?
私の WSDL ...asmx?WSDL には TestMeResponse 要素と TestMe 要素のスキーマ定義が含まれていますが、これを応答に含めるにはどうすればよいですか?