<%@ WebService Language="C#" Class="CustomWS.CustomService, CustomWS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=293c0f6de57e7690" %>
public
void
ProcessRequest(HttpContext context)
{
StringWriter sw1 =
new
StringWriter();
// Original - cop spdisco.aspx
context.Server.Execute(
"spdisco.disco.aspx"
, sw1);
XmlDocument spdiscoXml =
XmlDocument();
spdiscoXml.LoadXml(sw1.ToString());
var files = Directory.GetFiles(context.Server.MapPath(
""
),
"*.spdisco.aspx"
);
foreach
(var file
in
files)
StringWriter sw2 =
context.Server.Execute(System.IO.Path.GetFileName(file), sw2);
XmlDocument otherSPDiscoXml =
otherSPDiscoXml.LoadXml(sw2.ToString());
(XmlNode importedNode
otherSPDiscoXml.DocumentElement.ChildNodes)
spdiscoXml.DocumentElement.AppendChild(spdiscoXml.ImportNode(importedNode,
true
));
}
context.Response.Write(String.Format(
"<?xml version='1.0' encoding='utf-8' ?> {0}"
, spdiscoXml.InnerXml));
Akhirnya solusi Web Service kustom tersebut sudah siap untuk dibuild dan didistribusikan.