gpt4 book ai didi

objective-c - 将 NSString 参数传递给 SOAP WS 会产生 "Illegal processing instruction target ("xml")"

转载 作者:行者123 更新时间:2023-11-28 17:35:09 26 4
gpt4 key购买 nike

我正在使用 SudzC 生成的代码调用 WS:

[service createPendingSalesOrders:self action:@selector(handler:) arg0: 
@"<?xml version='1.0'"
" encoding='utf-8'?>"
"<root>test</root>"];

soap 请求是:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:com="http://com/">
<soapenv:Body>
<com:createPendingSalesOrders>
<arg0>"<?xml version='1.0' encoding='utf-8'?><root>test</root>"
</arg0>
</com:createPendingSalesOrders>
</soapenv:Body>
</soapenv:Envelope>

我收到:

[com.ctc.wstx.exc.WstxParsingException:非法处理指令目标(“xml”); xml(不区分大小写)由规范保留。

来 self 在 glassfish 上运行的 WS。

WS 与其他似乎包含相同 PI 的 XML 字符串一起工作。

感谢您的任何见解,丹麦人

最佳答案

如果您坚持将 xml 包装成 xml,请将内容放入 CDATA 部分,以便解析器将其作为字符串处理。

关于objective-c - 将 NSString 参数传递给 SOAP WS 会产生 "Illegal processing instruction target ("xml")",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10017936/

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