gpt4 book ai didi

c# - SPML (service provisioning markup language)/C#.Net 请帮忙!

转载 作者:太空宇宙 更新时间:2023-11-03 14:25:48 27 4
gpt4 key购买 nike

很抱歉,我实际上是在寻求帮助,但我的任务是处理上述问题,但找不到任何足够的资源来帮助我。详情如下:

  1. 该公司拥有身份管理软件,可为用户实体的更改提供 SPML (SOAP)“提要”

  2. (如果我做对了)SPML 驱动程序向发送这些更改的服务器上的 URL 发出 POST 请求

  3. 该 URL 下的任何内容都必须处理发布的信息 (XML)

第三点是我的点。我不知道该写什么。阿斯姆?阿斯普克斯? Ember ? Commodore 64 盒式磁带?显然 SPML 驱动程序需要一个 200 响应——它无论如何都会在处理发生时得到它,不是吗?还有什么我没有得到的吗?

任何帮助、指点、指导或建议我放弃并获得新的爱好,将不胜感激。

谢谢。

编辑......

有一个简单的 soap 驱动程序(出于测试目的)将 xml 发布到 aspx 页面,然后依次使用 POST 并保存 xml。感谢 J Benjamin(下)和 http://www.eggheadcafe.com/articles/20011103.asp启动。

SOAP 驱动程序(在页面加载时工作)

protected void Page_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(MySite.FileRoot + "testing\\testxml.xml");
HttpWebRequest req =
(HttpWebRequest)WebRequest.Create("http://localhost/mysite/testing/reader.aspx");
req.ContentType = "text/xml; charset=\"utf-8\"";
req.Method = "POST";
req.Headers.Add("SOAPAction", "\"\"");
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
Response.Write(r.ReadToEnd());
}

SOAP READER(读取调用时发布的 xml)

protected void Page_Load(object sender, EventArgs e)
{
String Folderpath = "c:\\TestSOAP\\";
if (!Directory.Exists(Folderpath))
{
Directory.CreateDirectory(Folderpath);
}
Response.ContentType = "text/xml";
StreamReader reader = new StreamReader(Request.InputStream);
String xmlData = reader.ReadToEnd();
String FilePath = Folderpath + DateTime.Now.ToFileTimeUtc() + ".xml";
File.WriteAllText(FilePath, xmlData);

下一步是尝试使用 SPML 服务(这是一个 Java 驱动的 Novell 类型的东西)——如果我有任何问题,我会在这里回复!!

谢谢大家..:)

最佳答案

也许我误解了,但这听起来与我在网络服务中处理 URL 的方式相似。我们正在处理基于 URL 的逻辑,执行逻辑,将其包装在 XML 中并使用 XML 对象进行响应。这是一个简单的示例(简单的意思是少数不需要身份验证的示例之一)

下面的代码只是返回一个包含 AppSetting 的 XML 对象。 XML 响应也在下方(删除了一些标识值)。

        [OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "External/Application/{ApplicationGUID}/APIHost/")]
public Response GetAPIHostName(Request request, string ApplicationGUID)
{
Response response = new Response();
try
{
APIHost apiHost = new APIHost
{
APIHostname = System.Configuration.ConfigurationManager.AppSettings["PlayerAPIHostname"]
};
response.ResponseBody.APIHost = apiHost;
response.ResponseHeader.UMResponseCode = (int) UMResponseCodes.OK;
}
catch (GUIDNotFoundException guidEx)
{
response.ResponseHeader.UMResponseCode = (int)UMResponseCodes.NotFound;
response.ResponseHeader.UMResponseCodeDetail = guidEx.Message;
}
catch (Exception ex)
{
UMMessageManager.SetExceptionDetails(request, response, ex);
if (request != null)
Logger.Log(HttpContext.Current, request.ToString(), ex);
else
Logger.Log(HttpContext.Current, "No Request!", ex);
}
response.ResponseHeader.HTTPResponseCode = HttpContext.Current.Response.StatusCode;
return response;
}

/"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 200 200 本地主机

关于c# - SPML (service provisioning markup language)/C#.Net 请帮忙!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4089048/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com