php获取wsdl文件以发送两个函数时出现问题


php Trouble getting wsdl file to send two functions

我正在尝试用PHP制作web服务,并且正在使用WSDL。

这是我的WSDL 的一个片段

 <wsdl:portType name="MyWSDLFilePort">
    <wsdl:operation name="funcA">
                    <documentation>this does something.</documentation>
        <wsdl:input message="tns:mGetRequest"></wsdl:input>
        <wsdl:output message="tns:mGetResponse"></wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="funcB">
        <wsdl:input message="tns:mGetRequest"></wsdl:input>
        <wsdl:output message="tns:mGetResponse"></wsdl:output>
    </wsdl:operation>
</wsdl:portType>

我希望在我的WSDL中有两个独立的函数,我希望它们做不同的事情。我的问题是看起来funcA和funcB在做同样的事情在我的客户端中,我添加了一个名为funcA的函数,它返回"I am func a",而在funcB中,我有一个返回"I are func B"。在WSDL客户端中,我调用funcA或B,得到"我是funcA"。如果你想让我在这里发布wsdl,我可以这样做。

顺便说一句,这是我第一篇关于堆栈溢出的文章。我的英语可能不好,我的描述也很糟糕。我提前道歉。

查看您的WSDL,很可能遇到了这个错误。(具有讽刺意味的是,在撰写本文时,PHP bug服务器已经关闭,但如果您搜索"PHP bug 49169",您应该能够从谷歌缓存中提取内容)。这个错误的影响是,如果有两个函数funcA和funcB具有相同的签名,PHP会在运行时根据函数签名在WSDL中查找该函数,并使用它遇到的第一个。因此,在您的示例中,我希望对funcA和funcB的调用始终作为funcA处理,因为这是首先定义的。

HTH。