如何在 PHP 中创建肥皂头?
我怎样才能创建这样的肥皂头:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestHeader>
<user>
<userId>ID</userId>
<password>Password</password>
</user>
<service>service</service>
</requestHeader>
How can I create a soap header like that:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestHeader>
<user>
<userId>ID</userId>
<password>Password</password>
</user>
<service>service</service>
</requestHeader>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你需要创建什么并不是太明显,但总的来说 PHP DOM 系列函数:
http://php.net/manual/en/book.dom.php
允许生成 XML,将结果保存到字符串中以供进一步使用。如果您通过 SOAP 进行通信,或者想要创建 SOAP 服务器,那么 PHP SOAP 函数是一个很好的资源:
http://www.php.net/manual/en/book.soap.php
It's not too apparent what you need the creation for, but in general the PHP DOM series of functions:
http://php.net/manual/en/book.dom.php
Allows for generation of XML, saving the result to a string for further use. If you're communicating through SOAP, or wanting to make a SOAP server, the PHP SOAP functions are a good resource:
http://www.php.net/manual/en/book.soap.php
我认为您正在谈论“登录”到 SOAP 服务器所必需的客户端标头,因此基于该假设,这看起来像是您想要做的事情:
I think you're talking about a client header that's mandatory for "logging in" to a SOAP server, so based on that assumption, this looks like the thing you want to do: