2012-01-17 63 views
1

我試圖讓一個web服務可以訪問Matlab。我可以從PHP調用它,但Matlab似乎無法解析定義。Matlab兼容.wsdl文件

??? 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文件作品。所以現在我試圖找出我的問題。建議?

回答

0

FWIW:有四個方面的問題:

1) '的xsd:複雜類型' 項需要在 '類型' 一節。 2)'service/port#binding'屬性需要是'tns:getRangeBinding'。

3) '的結合/操作/皁:操作#的soapAction' 應該是 '甕:XMethods的-GET-範圍:getRange'

4) '結合/操作/輸入/皁:本體#命名空間' 應比賽#3。