I'm having a problem calling web services from flex. My webservice is a doc/lit webservice that takes a complex type that expects the values in a specific sequence (wsdl below). The web service is expecting Password followed by Username, but flex cannot seem to make its mind up which order to pass the values in. Occasionaly it passes them in the correct order, but usually it passes them in the wrong order. The calls and responses are layed out below.

Is this a bug in Flex/Flash Player, or am I doing something wrong. (I am new to Flex)

Thanks in advance for your help

Flash Player - 8,5,0,212

Flex Builder2 - Beta 1

Here is the Web Service mxml definition

<mx:WebService id="loginWS" wsdl="http://localhost:8080/myWebService/LoginApplication?wsdl">
<mx:operation name="LoginApplication" result="getLoginResult(event)" fault="wsFault(event)">
<mx:request>
<LoginApplicationCallParameter>
<Password>
pbk
</Password>
<Username>
pbk
</Username>
</LoginApplicationCallParameter>
</mx:request>
</mx:operation>
</mx:WebService>

Here is the wsdl


<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://myweb.mycompany.com/wsdl" xmlns:wns="http://myweb.mycompany.com/wsdl" xmlns:tns="http://myweb.mycompany.com/LoginApplication">
<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://myweb.mycompany.com/LoginApplication" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://myweb.mycompany.com/LoginApplication">
<xsd:element name="LoginApplicationCallParameter">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Password" type="xsd:string"/>
<xsd:element name="Username" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="LoginApplicationResponseParameter">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SecurityToken" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:schema>
</wsdl:types>
<wsdl:message name="LoginApplicationCallParameter">
<wsdl:part name="LoginApplicationCallParameter" element="tns:LoginApplicationCallParameter"/>
</wsdl:message>
<wsdl:message name="LoginApplicationResponseParameter">
<wsdl:part name="LoginApplicationResponseParameter" element="tns:LoginApplicationResponseParameter"/>
</wsdl:message>
<wsdl:portType name="LoginApplicationInterface">
<wsdl:operation name="LoginApplication">
<wsdl:input message="wns:LoginApplicationCallParameter"/>
<wsdl:output message="wns:LoginApplicationResponseParameter"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="LoginApplicationBinding" type="wns:LoginApplicationInterface">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="LoginApplication">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="LoginApplicationService">
<wsdl:port name="LoginApplication" binding="wns:LoginApplicationBinding">
<soap:address location="http://localhost:8080/myWebService/LoginApplication"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Here is the calling code

private function callLoginNonAS()

{

loginWS.LoginApplication.send();

}

Here's the call data extracted from the debugger

<?xml version="1.0" encoding="utf-8"?>

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:LoginApplicationCallParameter xmlns:ns0="http://myweb.mycompany.com/LoginApplication"><ns0:Username>pbk</ns0:Username><ns0:Password>pbk</ns0:Password></ns0:LoginApplicationCallParameter></SOAP-ENV:Body></SOAP-ENV:Envelope>

Here is the response extracted from the debugger

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><SOAP:Fault><SOAP:faultcode>SOAP:Server</SOAP:faultcode><SOAP:faultstring>Internal server error: Error unmarshalling message body (Expected "{http://myweb.mycompany.com/LoginApplication}Password" start tag, found "{http://myweb.mycompany.com/LoginApplication}Username" start tag (line 2, col 300))</SOAP:faultstring><SOAP:detail><SOAP:DateTimeRaised>Thu Feb 02 09:52:29 GMT 2006</SOAP:DateTimeRaised><SOAP:ExceptionMessage>Error unmarshalling message body (Expected "{http://myweb.mycompany.com/LoginApplication}Password" start tag, found "{http://myweb.mycompany.com/LoginApplication}Username" start tag (line 2, col 300))</SOAP:ExceptionMessage><SOAP:ExceptionType>org.jibx.soap.SOAPException</SOAP:ExceptionType><SOAP:ExceptionTraceback> at org.jibx.soap.SOAPContext.getReceivePayload (null:-1)\r\n at org.jibx.soap.SOAPContext.unmarshalSOAP (null:-1)\r\n at org.jibx.soap.server.SOAPService.processRequest (null:-1)\r\n at org.jibx.soap.server.SOAPServlet.doPost (null:-1)\r\n at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)\r\n at javax.servlet.http.HttpServlet.service (HttpServlet.java:810)\r\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:237)\r\n at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:157)\r\n at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:214)\r\n at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)\r\n at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)\r\n at org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:198)\r\n at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:152)\r\n at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)\r\n at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)\r\n at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:137)\r\n at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)\r\n at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)\r\n at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:102)\r\n at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)\r\n at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)\r\n at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)\r\n at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)\r\n at org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:929)\r\n at org.apache.coyote.tomcat5.CoyoteAdapter.service (CoyoteAdapter.java:160)\r\n at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:793)\r\n at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection (Http11Protocol.java:702)\r\n at org.apache.tomcat.util.net.TcpWorkerThread.runIt (PoolTcpEndpoint.java:571)\r\n at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:644)\r\n at java.lang.Thread.run (Thread.java:534)\r\n</SOAP:ExceptionTraceback></SOAP:detail></SOAP:Fault></SOAP:Body></SOAP:Envelope>



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to