Matlab兼容的.wsdl文件

时间:2012-01-17 17:40:38

标签: matlab wsdl

我试图让Matlab可以访问Web服务。我可以用PHP调用它,但Matlab似乎无法解析定义。

??? Attempt to reference field of non-structure array.

Error in ==> createClassFromWsdl>parseWsdl at 72
se = defTypes.getExtensibilityElements().get(0);

Error in ==> createClassFromWsdl at 32
[R, schema] = parseWsdl(wsdlUrl);

WSDL文件:

<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='server3'
  targetNamespace='http://server.edu/php/soap_test/server3.wsdl'
  xmlns:tns='http://server.edu/php/soap_test/server3.wsdl'
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
  xmlns='http://schemas.xmlsoap.org/wsdl/'>



<xsd:complexType name="ActivityData">
  <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="HomeId" type="string"/>
    <xsd:element minOccurs="1" maxOccurs="1" name="TStamp" type="string"/>
    <xsd:element minOccurs="1" maxOccurs="1" name="Description" type="string"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="ArrayOfActivityData">
  <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="unbounded" name="keyval" type="tns:ActivityData"/>
  </xsd:sequence>
</xsd:complexType>  


<message name='getRangeRequest'>
  <part name='inHomeId' type='xsd:int'/>
  <part name='inStartDate' type='xsd:string'/>
  <part name='inEndDate' type='xsd:string'/>
</message>

<message name='getRangeResponse'>
  <part name='out1' type='ArrayOfActivityData'/>
</message>


<portType name='getRangePortType'>
  <operation name='getRange'>
    <input message='tns:getRangeRequest'/>
    <output message='tns:getRangeResponse'/>
  </operation>
</portType>

<binding name='getRangeBinding' type='tns:getRangePortType'>
  <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
  <operation name='getRange'>
    <soap:operation soapAction='urn:xmethods-get-range#getRange'/>
    <input>
      <soap:body use='encoded' namespace='urn:xmethods-get-range' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </input>
    <output>
      <soap:body use='encoded' namespace='urn:xmethods-get-range' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </output>
  </operation>
</binding>

<service name='getRangeService'>
  <port name='getRangePort' binding='getRangeBinding'>
    <soap:address location='http://server.edu/php/soap_test/soap_server3.php'/>
  </port>
</service>

</definitions>

阅读Matlab文档说明:

The createClassFromWsdl function works with WSDL documents that comply with the WS-I 1.0 standard and use one of these forms: RPC-encoded, RPC-literal, Document-literal, or Document-literal-wrapped.

我的Matlab安装适用于一些示例WSDL文件。所以现在我试图找出我的错误。建议?

1 个答案:

答案 0 :(得分:0)

FWIW:有四个问题:

1)'xsd:complexType'条目需要在'types'部分中。

2)'service / port#binding'属性必须是'tns:getRangeBinding'。

3)'binding / operation / soap:operation#soapAction'应为'urn:xmethods-get-range:getRange'

4)'binding / operation / input / soap:body#namespace'应匹配#3。