Nusoap 如何使用现有的 WSDL?

发布于 2024-12-18 18:35:05 字数 149 浏览 1 评论 0原文

所以我有一个 WSDL 作为肥皂服务的文档。我需要完全按照定义实现此服务,并且我不想使用 nusoap 重写 wsdl。有没有办法告诉对象 nusoap_server = newsoap_server();使用现有的 wsdl,然后实现现有 wsdl 中的功能?

谢谢

so I have a WSDL I've been giving as documentation for a soap service. I need to implement this service exactly as defined and I don't want to rewrite the wsdl using nusoap. Is there a way to tell the object nusoap_server = new soap_server(); to use an existing wsdl and then implement the functions from the existing wsdl?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乞讨 2024-12-25 18:35:05

$WSDL = '/path/to/wsdl/file';
$nusoap_server = 新soap_server($WSDL);

唯一的问题是 nusoap 可能无法正确创建响应,但它将托管 wsdl 文件。

我必须自定义我的 xml 响应。

您可以告诉 nusoap 这样做,但您需要修改库。

<?PHP     

function serialize_return() {
                    //$this->fuze_debug(array('test',$this->fuze_print_s($this->methodreturn)),'soap_server_debug.log');
                    $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
                    // if fault
                    if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
                            $this->debug('got a fault object from method');
                            $this->fault = $this->methodreturn;
                            return;
                            // for some reason with code ignitor this doesnot get set correctly
                    } elseif ($this->methodreturnisliteralxml) {
                            //$this->fuze_debug(array('literal xml is : ',$this->fuze_print_s($this->methodreturnisliteralxml)),'soap_server_debug.log');
                            $return_val = $this->methodreturn;
                    // returned value(s)
                    } else {

上面的代码位于 nusoap 库中,您可以看到 $this->methodreturnisliteralxml

如果将其设置为 true,那么您可以自定义从为 nusoap 定义的函数返回的 xml 来处理肥皂请求。

对我来说 nusoap 已经过时了。

我认为我不会在新项目中再次使用 nusoap。

$WSDL = '/path/to/wsdl/file';
$nusoap_server = new soap_server($WSDL);

The only problem with this is that nusoap may not create the response correctly, but it will host the wsdl file.

I had to customize my xml responses.

Which you can tell nusoap to do but you will need to modify the library.

<?PHP     

function serialize_return() {
                    //$this->fuze_debug(array('test',$this->fuze_print_s($this->methodreturn)),'soap_server_debug.log');
                    $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
                    // if fault
                    if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
                            $this->debug('got a fault object from method');
                            $this->fault = $this->methodreturn;
                            return;
                            // for some reason with code ignitor this doesnot get set correctly
                    } elseif ($this->methodreturnisliteralxml) {
                            //$this->fuze_debug(array('literal xml is : ',$this->fuze_print_s($this->methodreturnisliteralxml)),'soap_server_debug.log');
                            $return_val = $this->methodreturn;
                    // returned value(s)
                    } else {

This above code is in the nusoap library as you can see $this->methodreturnisliteralxml

If you set that to true then you can customize the xml you return from the function you define for nusoap to handle the soap request.

To me nusoap seams to be out of date.

I do not think I would use nusoap again for new projects.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文