如何用soap创建wsdl文件来访问api?

时间:2013-09-05 09:11:26

标签: php xml soap wsdl

我有示例xml请求和xsd架构来验证xml和url

如何创建wsdl文件

URL http://somewebsite:10806

is this the wsdl file on my server ?
targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"

also should i change <soap:address location="http://www.examples.com/SayHello/"> with 
<soap:address location="http://somewebsite:10806">

<definitions name="HelloService"
   targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <service name="Hello_Service">
      <documentation>WSDL File for HelloService</documentation>
      <port binding="tns:Hello_Binding" name="Hello_Port">
         <soap:address
            location="http://www.examples.com/SayHello/">
      </port>
   </service>

1 个答案:

答案 0 :(得分:0)

使用Apache XSD to WSDL

  

targetNameSpace是我服务器上的wsdl文件吗?   没有;它是你组成的命名空间声明。更多信息:here in this SO answer

是的,您应该从

更改soap:地址
<soap:address location="http://www.examples.com/SayHello/">

到正确的地址,例如:

<soap:address location="http://somewebsite:10806/SayHello/">