を使ってみた。送信はOKなんだけど、受信はそのままバインドできないみたい。
xml version="1.0" encoding="utf-8"
<mxApplication xmlnsmx="http://www.adobe.com/2006/mxml" layout="absolute">
<mxButton label="BookshelfTest" y="10" left="10" click="testClick()"/>
<mxWebService id="webService" wsdl="http://localhost:8080/s2axis-examples/services/Bookshelf?wsdl">
<mxoperation name="getBooks" result="_nextFunction.apply(this, [event])" fault="Alert.show(event.toString())">
</mxoperation>
<mxoperation name="addBook" result="_nextFunction.apply(this, [event])" fault="Alert.show(event.toString())">
</mxoperation>
<mxoperation name="getBook" result="_nextFunction.apply(this, [event])" fault="Alert.show(event.toString())">
</mxoperation>
</mxWebService>
<mxModel id="MyBook">
<Book>
<title/>
<author/>
<isbn/>
</Book>
</mxModel>
<mxScript>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private var _nextFunction: Function;
public function testClick(): void {
step1();
}
private function step1(): void {
_nextFunction = step2;
webService.getBooks();
}
private function step2(event: ResultEvent): void {
if ((event.result as ArrayCollection).length != 0) {
trace("assert: " + event);
}
_nextFunction = step3;
MyBook.title = "Building Web Services with Java";
MyBook.author = "Steve Graham, et al.";
MyBook.isbn = "ISBN0-672-32641-8";
webService.addBook(MyBook);
}
private function step3(event: ResultEvent): void {
_nextFunction = step4;
MyBook.title = "Designing Web Services with the J2EE 1.4 Platform";
MyBook.author = "Inderjeet Singh, et al.";
MyBook.isbn = "ISBN0-321-20521-9";
webService.addBook(MyBook);
}
private function step4(event: ResultEvent): void {
_nextFunction = step5;
webService.getBook("ISBN0-672-32641-8");
}
private function step5(event: ResultEvent): void {
_nextFunction = step5;
MyBook.title = event.result.title;
MyBook.author = event.result.author;
MyBook.isbn = event.result.isbn;
if ("Building Web Services with Java" != MyBook.title) {
trace("assert: " + event);
}
if ("Steve Graham, et al." != MyBook.author) {
trace("assert: " + event);
}
if ("ISBN0-672-32641-8" != MyBook.isbn) {
trace("assert: " + event);
}
_nextFunction = step6;
webService.getBook("ISBN0-321-20521-9");
}
private function step6(event: ResultEvent): void {
MyBook.title = event.result.title;
MyBook.author = event.result.author;
MyBook.isbn = event.result.isbn;
if ("Designing Web Services with the J2EE 1.4 Platform" != MyBook.title) {
trace("assert: " + event);
}
if ("Inderjeet Singh, et al." != MyBook.author) {
trace("assert: " + event);
}
if ("ISBN0-321-20521-9" != MyBook.isbn) {
trace("assert: " + event);
}
}
]]>
</mxScript>
</mxApplication>