I am new to Flash 8. I am trying to consume a web service that is running on my
Java EE 5 (GlassFish) application server. First, can anyone comment on
compatability of Flash 8 with web services not created with Cold Fusion.
I am able to connect and execute a sample web (wsdl at
http://www.flash-mx.com/mm/tips/tips.cfc?wsdl).
This works for me.
But when I try to call a very simple service that I have defined using Java
JAX-WS, I don't see a response. I have attached action script code and xml for
my wsdl.
Most samples and tutorials that I have seen so far involve web services
defined in ColdFusion. However, what I need to do in my Flash 8 document is
directly access a web service defined and running in Jave EE 5 environment.
Does Flash 8 support this type of interoperability? Can anyone provide some
hints on how to get this working?
Thanks
import mx.data.components.WebServiceConnector;
_global.__dataLogger=new mx.data.binding.Log();
var res:Function = function (evt:Object) {
trace("result--->" + evt.target.results);
};
var stat:Function = function(evt:Object) {
trace("stat---->" + evt.target.status);
};
var wsConn:WebServiceConnector = new WebServiceConnector();
wsConn.addEventListener("result", res);
wsConn.addEventListener("status", stat);
wsConn.WSDLURL =
"http://maniac.ckint.com:18181/SessionTest/SessionTestService?WSDL";
wsConn.operation = "getSessionInfo";
wsConn.params = [];
wsConn.suppressInvalidCalls = true;
wsConn.trigger();
Here is the xml for wsdl....
<?xml version="1.0" encoding="UTF-8"?><definitions
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://endpoint/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="http://endpoint/"
name="SessionTestService">
<types>
<xsd:schema>
<xsd:import namespace="http://endpoint/"
schemaLocation="http://maniac.ckint.com:18181/SessionTest/SessionTestService/__c
ontainer$publishing$subctx/WEB-INF/wsdl/SessionTest
Service_schema1.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
</xsd:schema>
</types>
<message name="getSessionInfo">
<part name="parameters" element="tns:getSessionInfo"/>
</message>
<message name="getSessionInfoResponse">
<part name="parameters" element="tns:getSessionInfoResponse"/>
</message>
<portType name="SessionTest">
<operation name="getSessionInfo">
<input message="tns:getSessionInfo"/>
<output message="tns:getSessionInfoResponse"/>
</operation>
</portType>
<binding name="SessionTestPortBinding" type="tns:SessionTest">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<operation name="getSessionInfo">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="SessionTestService">
<port name="SessionTestPort" binding="tns:SessionTestPortBinding">
<soap:address
location="http://maniac.ckint.com:18181/SessionTest/SessionTestService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
</port>
</service>
</definitions>
Morris01 - 25 Sep 2006 11:48 GMT
Hi Tom,
I've been running into the same problem, having JAX-WS generating the WSDL for
me and Flash telling me that it cannot consume the corresponding Web Service.
According to an article I found on the Developer Center site (
http://www.adobe.com/devnet/flash/articles/flmxpro_webservices_03.html ),
"Flash MX Professional 2004 does not support web services that use the import
tag". I haven't been able to find any reference that indicates whether this has
changed for Flash 8.
I tried to contact the author of the article (who is no longer with Adobe),
but so far she has ignored my attempts.
Our problem thus may lie in the Flash's inability to process the import tag,
although this has at least been part of the specification since WSDL 1.1.
There has been no mentioning of a true workaround for this: the JAX-WS people
don't offer an option to have the schema created inline - and IMHO rightfully
so. They hold their end of the deal (generating a WSDL document that is valid
according to the standard) for which they used the most flexible option (it
allows for reuse of schemas between multiple WSDL definitions).
The only thing I guess you can do is manually inline the separate XSD file(s)
into the WSDL file and then feed it to Flash...
It is up to the Flash developers to fix this problem and have their tool
comply with the official W3C standards. It cannot be that such a widely used
tool renders itself obsolete by disregarding interoperability with other widely
used technologies...
Sorry I cannot be of more help. Seems I'm stuck with the same problem for now
as well...or maybe someone out there has better insights and helps us out?
Grtz,
Morris