在 Javascript 中发布 SOAP
Publish SOAP in a Javascript
本文关键字:SOAP Javascript 更新时间:2023-09-26
有人看到我在这里穿什么吗?我试图在我的asp网站中使用此脚本。$z:value[article.number] 是我在 ASP 中的 art.number。当我点击我的文章时,我的意图会看到图片。
此致敬意弗兰克
<script type="text/javascript">
var symbol = "MSFT";
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "http://produktinfo.byggtjeneste.no/ProduktInfo.asmx?op=HentBildeLenkeTyped",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4) {
alert(xmlhttp.responseText);
var json = XMLObjectifier.xmlToJSON(xmlhttp.responseXML);
var result = json.Body[0].HentBildeLenkeTypedResponse[0].HentBildeLenkeTypedResult[0].Text;
json = XMLObjectifier.xmlToJSON(XMLObjectifier.textToXML(result));
alert(SModulNr + ' ProduktInfo: $' + json.Stock[0].Last[0].Text);
}
}
xmlhttp.setRequestHeader("SOAPAction", "http://produktinfo.byggtjeneste.no/HentBildeLenkeTyped");
xmlhttp.setRequestHeader("Content-Type", "text/xml");
var xml = '<?xml version="1.0" encoding="utf-8"?>' +
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
'<soap:Body> ' +
'<HentBildeLenkeTyped xmlns="http://produktinfo.byggtjeneste.no/"> ' +
'<sModulNr> + $z:value[article.number] + </sModulNr> '+
'<iSize>xlarge</iSize> '+
'</HentBildeLenkeTyped> ' +
'</soap:Body> ' +
'</soap:Envelope>';
xmlhttp.send(xml);
</script>
这是我的提供者的原始文件。
POST /ProduktInfo.asmx HTTP/1.1
Host: produktinfo.byggtjeneste.no
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<HentBildeLenkeTyped xmlns="http://produktinfo.byggtjeneste.no/">
<sModulNr>string</sModulNr>
<iSize>None or small or large or xlarge or original or largeThumbnail</iSize>
</HentBildeLenkeTyped>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<HentBildeLenkeTypedResponse xmlns="http://produktinfo.byggtjeneste.no/">
<HentBildeLenkeTypedResult>string</HentBildeLenkeTypedResult>
</HentBildeLenkeTypedResponse>
</soap12:Body>
</soap12:Envelope>
此行
'<sModulNr>$z:value[article.number]</sModulNr> '
是你出错的地方。 您实际上是在请求值"$z:value[article.number]"而不是您想要的文章编号。
我不清楚您发布的内容$z是什么,但您可能想要更多类似的东西
'<sModulNr>' + $z:value[article.number] + '</sModulNr>'
相关文章:
- 使用带有JavaScript的SOAP WebService
- 如何通过安全的https连接在javascript中使用基于soap xml的Web服务
- 从Javascript连接到SOAP Web服务
- 显示IIS上javascript文件(SOAP请求)的XML响应
- 如何在javascript或jquery中调用 asp.net 基于3.5 soap xml的Web服务
- JavaScript SOAP客户端接收到null
- 如何使用JavaScript创建带有SOAP消息的请求
- 使用XPath在JavaScript中解析(基于SOAP的)XML
- 将php-soap请求转换为javascript
- 允许从 JavaScript 到 GlassFish 上的 SOAP Web 服务的跨源
- 在 Javascript 中发布 SOAP
- 通过 Javascript 向 Azure 上的 WCF Web 服务发出 SOAP 请求
- 使用 jQuery/JavaScript 从 SOAP 响应解析 XML
- 使用 JavaScript 将 SOAP/XML 命名空间提取为键/值对列表
- 使用 Javascript 从 SOAP 中提取数据
- 如何将图像从移动web应用程序(PhoneGap&JavaScript)上传到SOAP web服务
- IONIC框架(AngularJs&JavaScript)|是推荐的基于SOAP的web服务
- 如何使用javascript从soap中读取方法名称
- 用javascript处理来自soap wsdl的JSON响应
- 什么是SOAP JavaScript代理