非常に基本的なWebサービス「操作」を「hello」という操作で作成しました。それはSoapUIから完全に動作しますが、Matlab 2014aを使用すると、入力パラメータは決して取得されません。したがって、hello()は常に「Hello null!」を返します。 addition()などの他の操作は常に0を返します。私はMatlabのヘルプに従っており、何が起こっているのかを見ることができません。私がやっていることMatlabから呼び出されるこのWebサービスがnullを受け取るのはなぜですか?
は次のとおりです。
>> createClassFromWsdl('http://ip/WebServiceTest/operation?wsdl')
ans = operation
>> obj = operation
endpoint: 'http://ip/WebServiceTest/operation'
wsdl: 'http://ip/WebServiceTest/operation?wsdl'
>> methods(obj)
addition display hello operation
>> hello(obj, 'John')
ans =
Hello null!
これは、Webサービスが正しく呼び出されることを実証しているとそれが答えを返しますが、入力パラメータが得られません。私は、SOAPメッセージを確認するために、ネットワークトラフィックをキャプチャしている
function xReturn = hello(obj,name)
%hello(obj,name)
%
% Input:
% name = (string)
%
% Output:
% return = (string)
% Build up the argument lists.
values = { ...
name, ...
};
names = { ...
'name', ...
};
types = { ...
'{http://www.w3.org/2001/XMLSchema}string', ...
};
% Create the message, make the call, and convert the response into a variable.
soapMessage = createSoapMessage(...
'http://webservices/', ...
'hello', ...
values,names,types,'document');
response = callSoapService(...
obj.endpoint, ...
'', ...
soapMessage);
xReturn = parseSoapResponse(response);
とMatlabのは確かにパラメータを送信し、メッセージが正常に見える:
生成されたコードhello.m
は、私には罰金だ
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<hello xmlns="http://webservices/">
<name xsi:type="xs:string">John</name>
</hello>
</soap:Body>
</soap:Envelope>
SoapUIから返された同じメッセージ、正しいHello John!の値は次のようになります。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices/">
<soapenv:Header/>
<soapenv:Body>
<web:hello>
<!--Optional:-->
<name>John</name>
</web:hello>
</soapenv:Body>
</soapenv:Envelope>
何が起こっていますか?私もログでこれを発見した
EDIT
:
Received WS-I BP non-conformant Unquoted SoapAction HTTP header