Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java EE (J2EE) и Spring > WebService Calculator (netbeans) и ActionScript


Автор: kilobok 7.11.2008, 23:04
Помогите с таким делом.
Создаю Веб-Сервис калькулятор по образцу в netbeans 6.1, по умолчанию создается операция add двух чисел. Автоматически генерируется файл wsdl. Который я потом кормлю Flash-у (а именно ActionScript-у)
Вылетает ошибка: 
WSDL.BadElement
Element tns:addResponse not resolvable

я так понимаю, что проблема заключается в том что Flash не пользуется тэгом import из файла wsdl и не погружает xsd схему.
Если это так то у меня сл. вопрос, как сделать так чтобы xsd схема была сразу же вшита в wsdl?
иными словами, чтобы валидный wsdl создавался без неё.

Очеь прошу помощи, т.к. уже третий день парюсь над этой проблемой..........

на всяк случай привожу код ActionScript (2 куска, сам ничего не писал, эти куски взяты из хелпа Adobe Flash)
Код

import mx.data.components.WebServiceConnector;

var fault = function (stat) {
    if (stat.code == "WebServiceFault"){
        trace(stat.data.faultcode);
        trace(stat.data.faultstring);
        trace(stat.data.detail);
        trace(stat.data);
        
    }
};

var wscListener:Object = new Object();
wscListener.result = function(evt:Object) {
trace(evt.target.results);
};


var wsConn:WebServiceConnector = new WebServiceConnector();
wsConn.addEventListener("status", fault);
wsConn.addEventListener("result", wscListener);

wsConn.WSDLURL = "http://localhost:8080/CalculatorApp/CalculatorWSService?wsdl";
wsConn.operation = "add";
wsConn.params = [6,8];
wsConn.trigger();

Автор: powerOn 8.11.2008, 00:24
http://forums.java.net/jive/thread.jspa?messageID=298755



Автор: kilobok 8.11.2008, 00:32
че то я не понял=) можно подробнее?

Автор: kilobok 8.11.2008, 01:16
проблема не решена... 

Автор: powerOn 8.11.2008, 01:41
на форуме задают такой же вопрос как и у тебя:
Цитата

wsgen generates WSDL which internally used xsd:import to import the schema defining the complex types. When I build bindings from it under Axis 1.4 all is well. However when I attempt to build the bindings under Power Builder it complains saying that it can't parse the WSDL (no additional details). Through trial and error, I noticed that PB dosen't have an issue when the schema is included as opposed to imported. So I did some reading and to my understanding import only brings in other namespaces and the schemaLocation attribute is optional. Includes on the other hand bring other declarations into the current namespace.

I guess, I have few questions:

1) Why does wsgen uses imports as opposed to includes.
2) Is there any way I can change the behavior? 


краткий смысловой перевод: "почему wsgen при создании WSDL не может включить схему сданными непосредствено в описание, а не линковать его с помощью import?"

на что ему ответили:

Цитата

There is a RFE to inline the schemas in wsdl instead of importing them. Currently it is not possible to inline schemas in wsdl with wsgen, But a good stack should digest these wsdls without any problem.
Regarding schema imports, If the targetNamespaces are different, it would use xsd:import instead of xsd:include.

One possible option is to generate the wsdl using wsgen and modify it as per your needs and treat it as a fromwsdl deployment by packaging the modified wsdl.


краткий смысловой перевод: "В данный момент включение схем в WSDL невозможно. Но если тот, кто её будет использовать не написан криво, то должен съесть WSDL и в таком виде... Как из вариант можно скачать схему, поправить её руками, перезапаковать проект с новой схемой."


Автор: fronya 8.11.2008, 05:30
Ну kilobok имел ввиду не создавать копию wsdl и менять ее ручками (включая xsd схему) а во Flash ссылаться на копию а не на "оригенал", т.к. это очень не удобно, постоянно переделывать руками wsdl файл, при изменении WebService (допустим захотел добавить метод).... 
а "xsd import", Flash не проглотит......  smile 

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)