3

我想在 nusoap 上创建 xml 架构,如下所示:

<xsd:complexType name="WSMessage">
    <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="1" name="ErrorMessage" type="s:string"/>
        <xsd:element minOccurs="0" maxOccurs="1" name="ErrorCode" type="s:string"/>
    </xsd:sequence>
</xsd:complexType>

<s:complexType name="ResultSet">
    <s:complexContent mixed="false">
        <s:extension base="tns:WSMessage">
            <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="TestData" type="tns:ArrayOfTestData"/>
            </s:sequence>
        </s:extension>
    </s:complexContent>
</s:complexType>

我看不到任何关于如何做到这一点的文档。有人知道吗?谢谢你。

4

1 回答 1

0

添加两个复杂类型的输入,我在你的问题中理解的是它的输入和输出

$this->nusaop->wsdl->addComplexType(
            'WSMessage',
            'complexType',
            'struct',
            'all',
            '',
            array(
                'ErrorMessage ' => array(
                    'MethodParameters' => 'ErrorMessage',
                    'type' => 'xsd:string'
                ),
                'ErrorCode' => array(
                    'MethodParameters' => 'ErrorCode',
                    'type' => 'xsd:string'
                )
               )
        );

/输入数据类型/

$this->nusaop->wsdl->addComplexType(
            'ResultSet',
            'complexType',
            'struct',
            'all',
            '',
            array(
                'TestData' => array(
                    'MethodParameters' => 'TestData',
                    'type' => 'xsd:string'
                ),
            )
        );

/输出数据类型/

$this->FM_SoapServer->register(
        'Methodcall',// parameter list:
        array('Credentials'=>'tns:WSMessage'),// return value(s):
        array('return'=>'tns:ResultSet'),// namespace:
        false,// soapaction: (use default)
        false,// style: rpc or document
        'rpc',// use: encoded or literal
        'encoded',// description: documentation for the method
        ''
    );



function Methodcall(){
  ///  validations ....
  code....
  return array("ResultSet" => $return);

}

未经测试,但逻辑在那里

于 2016-12-15T05:10:52.487 回答