gpt4 book ai didi

php - 设置 SOAP-ENV Nusoap 的值

转载 作者:搜寻专家 更新时间:2023-10-31 22:04:00 25 4
gpt4 key购买 nike

如何更改我的 Soapenv:Envelope 参数:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ejb="http://ejb.gateway.ebpp.fawryis.com/"
xmlns:ns3678="http://tempuri.org">

为此:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ejb="http://ejb.gateway.ebpp.fawryis.com/">

如何设置nusoap客户端Soapenv才能和第二种格式一样?

同样在每个元素中都有 xmlns 空属性:

<process xmlns="http://ejb.gateway.ebpp.fawryis.com/">
<arg0 xmlns=""><Request xmlns="">

如何删除那些xmlns属性?


这是我的代码:


$client = new nusoap_client($wsdl_path,   TRUE);

$client->namespaces = array(
'SOAP-ENV'=>"http://schemas.xmlsoap.org/soap/envelope/",
'ejb'=>"http://ejb.gateway.ebpp.fawryis.com/"
);
$parameters = array(//the parameters );
$result = $client->call("process", $parameters);

谢谢

最佳答案

我知道您可以 fork Nusoap 项目并自定义 nusoap.php 源代码以返回您想要的内容。但请注意,有些人告诉我们,我们不需要为这个前缀 SOAP-ENV 而烦恼。如果您不关心正在序列化哪个(SOAP-ENV 或 soap 前缀),请继续使用原始的 nusoap 项目。请记住输入相同的命名空间。

这里有一些额外的信息:

You can use any string you like as a namespace prefix, just as long as it maps to the appropriate namespace name. The reason why the spec bothers with telling us the notational conventions is that prefix names (e.g., SOAP-ENV) aren't normative.

来源:SOAP-ENV vs. soapenv

...as long as soap and SOAP-ENV refer to the same namespace URI, then everything will be OK.

来源:SOAP-ENV: vs. soap:Envelope

...can be any allowed string - it does not matter to the XML parser as long as the correct namespace URL has been given.

来源:SOAP Envelope namespace

关于php - 设置 SOAP-ENV Nusoap 的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22487775/

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