php soap server自己的前缀元素

时间:2017-06-07 11:19:11

标签: php soap wsdl

我用php编程我的肥皂服务器,服务器使用"标准"代码:

$options = array('uri' => 'http://myserver/wsdl', 'soap_version' => SOAP_1_1 );
$server = new SoapServer("http://myserver/wsdl/wsas.wsdl", $options );
$server -> setClass("myclass"); 
$server->handle();

系统与常见的wsdl结构完美配合:

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://myserver/wsdl.php">
   <soapenv:Header/>
   <soapenv:Body>
      <wsdl:element1>
         <subelement1>
            <subId1>?</subId1>
            <subName1>?</subName1>
         </subelement1>
         <subpart>
            <subIdp>?</subId1>
            <subNamePart>?</subName1>
         </subpart>
    ...

wsas.wsdl结构:

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsas="http://myserver/wsdl.php" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsas" targetNamespace="http://myserver/wsdl.php">
  <wsdl:types>
    <xsd:schema targetNamespace="http://myserver/wsdl.php">
      <xsd:element name="element">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="subelement1" minOccurs="1" maxOccurs="1">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="subId1" type="xsd:int" minOccurs="1" maxOccurs="1"/>
                  <xsd:element name="subName1" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="subpart" minOccurs="0" maxoccurs="unbounded">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="subIdp" type="xsd:int"/>
                  <xsd:element name="subNamePart" type="xsd:int"/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
...

客户端发送的结构不同,应该是 wsas:element 而不是 element1 。 我在这里搜索,谷歌搜索它,但无法找到答案。我尝试更改名称,更改定义,没有任何作用。

我如何获得标签&#34; wsas:element&#34;工作

由于

0 个答案:

没有答案