【发布时间】:2012-11-12 16:27:15
【问题描述】:
我创建了一个简单的头类:
Class Sample.Headers Extends %SOAP.Header
{
Parameter NAMESPACE = "http://tempuri.org";
Property UserName As %String;
}
在 Web 服务中,我确保在 SOAPHEADERS 参数中设置了正确的命名空间:
Parameter SOAPHEADERS = "UserName:Sample.Headers";
我使用 SoapUI 发送以下 XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org">
<soapenv:Header>
<tem:UserName>This is the header</tem:UserName>
</soapenv:Header>
<soapenv:Body>
<tem:Test>
<!--Optional:-->
<tem:argAge>10</tem:argAge>
</tem:Test>
</soapenv:Body>
</soapenv:Envelope>
我收到以下错误:
错误 #6254:需要标记,XML 输入,这是标题,不在 作为 UserName 的子级的正确格式(在第 3 行字符 18 处结束)。
为了正确设置用户名,XML 的正确格式是什么?
【问题讨论】:
标签: xml web-services soap intersystems-cache intersystems