我已经使用NuSOAP库编写了一个ws SOAP服务器,它工作得很好,但是由于客户端应该是一个SAP实现,所以在尝试从SAP访问它时会有一些问题。我的WSDL是由nusoap自动生成的,它包含以下定义
<definitions targetNamespace="https://example.com/ws/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="https://example.com/ws/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="https://example.com/ws/">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>这个WSDL是由soap-UI5.5验证的,它可以很好地用于php客户端,但不能用于SAP。首先,我必须从rpc/encoding风格切换到document/literal风格,我可以通过更改nusoap服务器类中的一些配置值来实现它。
无论如何,还有一个遗留的问题,根据思爱普诊断,它是由<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>触发的。
在SAP中的错误是Incorrect value: Unknown namespace http://schemas.xmlsoap.org/soap/encoding/我已经测试过这个url,并且是正确的。我还试图从soap服务器类中去掉这一行,但没有成功,因为我找到了它,并在class.soap_server.php中的第1106行进行了注释
$this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/soap/encoding/'][0] = array('location' => '', 'loaded' => true);但是它对生成的wsdl没有任何影响。
任何想法都会得到我们的赞赏。提前谢谢你。
发布于 2019-08-28 01:44:09
我必须从rpc/编码样式切换到文档/文本样式
SAP不支持Web服务中的RPC样式,因此出现错误。
下面是SAP注释,它解释了如何适应它
https://launchpad.support.sap.com/#/notes/856597 / Offline version
I示例,它们解释了注释中包含的WSDL格式,以防您没有使用S- attach来访问注释。
https://stackoverflow.com/questions/57627589
复制相似问题