具有相同名称的 WSDL 函数.如何选择一个? [英] WSDL functions with the same name. How to choose one?
问题描述
我将提供程序 wsdl 与 SoapClient 一起使用,但是当我使用命令 __getFunctions 时,我得到如下内容:
I'm using a provider wsdl with SoapClient but when I use the command __getFunctions I get something like this:
method1Rsp service(method1Req $parameters)
method2Rsp service(method2Req $parameters)
method3Rsp service(method3Req $parameters)
method4Rsp service(method4Req $parameters)
method5Rsp service(method5Req $parameters)
所以,我只能调用函数service()"或使用 __soapCall('service',$info)
但我总是得到method1"模式.如果我使用 __doRequest()
我可以在自己编写的 xml 中发送我想要的方法并且工作正常,但很遗憾......如果我在 $info 数组中发送方法名称,它也会使用第一种方法.
So,I can only call the function "service()" or use __soapCall('service',$info)
but I always get the "method1" schema.
If I use __doRequest()
I can send the method I want in a self writen xml and works fine, but it's a pity...
If I send the method name in the $info array, it also uses the first method.
问题:有没有办法使用__soapCall()
或者service函数调用特定的方法,或者我必须修改wsdl?
Question: Is there a way to call specific methods using __soapCall()
or the service function, or I have to modify the wsdl?
编辑:
这是一个与 __doRequest
一起使用的 xml 请求:
Here is a xml request used with __doRequest
:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<LowFareSearchReq TargetBranch="" xmlns="http://www.travelport.com/schema/air_v20_0" xmlns:com="http://www.travelport.com/schema/common_v17_0">
<com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
<SearchAirLeg>
<SearchOrigin>
<CityOrAirport Code="LON" xmlns="http://www.travelport.com/schema/common_v17_0" />
</SearchOrigin>
<SearchDestination>
<CityOrAirport Code="MUC" xmlns="http://www.travelport.com/schema/common_v17_0" />
</SearchDestination>
<SearchDepTime PreferredTime="2013-02-10" />
<AirLegModifiers>
<PreferredCabins>
<CabinClass Type="Economy" />
</PreferredCabins>
</AirLegModifiers>
</SearchAirLeg>
<SearchPassenger Code="ADT" Age="30" xmlns="http://www.travelport.com/schema/common_v17_0"/>
<AirPricingModifiers CurrencyType="EUR">
</AirPricingModifiers>
</LowFareSearchReq>
</s:Body>
</s:Envelope>
Web 服务的位置是 http://webservicename/AirService
,尽管您必须使用这种方法.这工作正常,但响应也是和 xml 字符串.此外,如果我在将来的更新中更改 wsdl 文件,则不会更新模式.使用 __soapCall
返回一个 stdClass 对象并自动获取模式.
The location of the webservice is http://webservicename/AirService
despite the method you have to use.
This works okay, but the response is also and xml string. Further more, the schemas are not updated if I change the wsdl file in a future update. Using __soapCall
returns an stdClass object and gets the schemas automatically.
推荐答案
我认为您可以使用自定义参数(method1Req 或 method2Req 等)调用服务.和 PHPSoap 库自己确定必要的方法
I think you can call service with custom paramert (method1Req or method2Req, etc). And PHPSoap library determine necessary method itself
这篇关于具有相同名称的 WSDL 函数.如何选择一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!