简体   繁体   English

从现有的wsdl获取PHP SOAP位置和uri

[英]Get PHP SOAP location and uri from existing wsdl

which attributes from existing WSDL do I have to use in order to get the same functionality in non-wsdl mode? 我必须使用现有WSDL中的哪些属性才能在非wsdl模式下获得相同的功能? I would like to use non wsdl SoapClient in PHP but I can't get the correct configuration. 我想在PHP中使用非wsdl SoapClient但我无法获得正确的配置。 I want to use Salesforce SOAP API but I don't want to store the wsdl file localy. 我想使用Salesforce SOAP API但我不想存储wsdl文件localy。 I created that wsdl file and it works when i use it like this 我创建了那个wsdl文件,当我像这样使用它时它可以工作

$soap = new \SoapClient("enterprise.wsdl.xml"); 

but I would prefer this way 但我更喜欢这种方式

$soap = new \SoapClient(null, [
     "location" => "#SomeValueThatICanFindInTheActualWSDL#",
     "uri" => "#SomeOtherValueThatICanFindInTheActualWSDL#",
]);

which wsdl attributes should I use as location and uri? 我应该使用哪个wsdl属性作为位置和uri?

If you paste the WSDL url into your web browser, this will give you a large XML document (you may need to add ?wsdl to the url), which has the 2 variables you are looking for. 如果将WSDL URL粘贴到Web浏览器中,这将为您提供一个大型XML文档(您可能需要将?wsdl添加到URL中),该文档包含您要查找的2个变量。

To find the location, search for the following node: 要查找位置,请搜索以下节点:

<wsdl:import namespace="http://www.[some namespaceurl]" location="https://[the location url you want]" /> 

For the URI, you generally just remove the file name and/or folder structure off the URL. 对于URI,通常只需从URL中删除文件名和/或文件夹结构。 For example if your service is: 例如,如果您的服务是:

https://somedomain.com/folder1/folder2/somefile.svc?wsdl

Then the URI could be: 那么URI可以是:

https://somedomain.com/folder1/folder2

or 要么

https://somedomain.com/folder1

or 要么

https://somedomain.com

You'll just need to trial and error until you find what works. 你只需要试验和错误,直到找到有效的方法。 Hope this helps. 希望这可以帮助。

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

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