简体   繁体   English

在PHP SOAP中使用固定的WSDL文件

[英]Using Fixed WSDL file with PHP SOAP

I' developing a Soap Server using php nusoap library, however , I don't need to use dynamic generated WSDL file feature that's generated by nusoap , I just want to tell nuSoap to use the Fixed WSDL file that's written manully by an another team. 我正在使用php nusoap库开发Soap Server,但是,我不需要使用nusoap生成的动态生成的WSDL文件功能,我只想告诉nuSoap使用由另一个团队手动编写的Fixed WSDL文件。

What do you suggest ? 你有什么建议?

My suggestion - give up. 我的建议-放弃。 I'm not entirely sure that you can do what you want. 我不确定您可以做什么。

As you know, NuSOAP creates the WSDL on the fly only from the functions that you specify and then returns the resultant WSDL when requested. 如您所知,NuSOAP 根据您指定的函数动态创建WSDL,然后在请求时返回结果WSDL。

If you could use an external fixed WSDL, what would happen if it is changed later on without your knowledge? 如果您可以使用外部固定的WSDL,如果以后在您不知情的情况下对其进行更改,将会发生什么? A call to a SOAP method which is not handled by one of your functions could provide unknown results and would need to be handled by the calling machine in a nice, non-customer impacting way. 对未由您的函数之一处理的SOAP方法的调用可能会提供未知的结果,并且需要由调用方以一种对客户无影响的方式进行处理。 Conversely, if you provide a new functionality but the other team won't adjust the WSDL for you, what do you do? 相反,如果您提供了一项新功能,但另一个团队不会为您调整WSDL,那么您会怎么做? Try and shoe-horn it into some other function? 试着把它拔成其他功能吗?

Trying to match your functions to a pre-defined WSDL without errors would far out-strip any benefit you could get. 尝试将功能与预定义的WSDL匹配而没有错误将远远超出您可以获得的任何好处。

Stick with the "on-the-fly" generation for consistency and lack of headaches. 坚持使用“实时”生成,以保持一致性并避免头痛。 Use the pre-generated WSDL as a reference but don't bother investigating whether you can use it 使用预先生成的WSDL作为参考,但不必担心是否可以使用它

Also, I agree with @chrfin. 另外,我也同意@chrfin。 If they are available on your server, consider using the native PHP SOAP functions - they are noticeably faster than NuSOAP as they are compiled rather than interpreted. 如果它们在您的服务器上可用,请考虑使用本机PHP SOAP函数-在编译而不是解释时,它们明显比NuSOAP快。 The only reason I used NuSOAP in the first place was that (about 5 years ago) the native SOAP had problems communicating with a provider I needed (incorrect variable types etc). 我首先使用NuSOAP的唯一原因是(大约5年前)本机SOAP与我需要的提供程序进行通信时遇到了问题(变量类型不正确等)。 Now though, I will be re-factoring all of my code to native PHP SOAP 现在,尽管如此,我将所有代码重构为原生PHP SOAP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM