0 Replies Latest reply on Mar 8, 2007 2:41 PM by oregontarheel

    Problem with consuming web services in Flex

    oregontarheel
      So i'm trying to set up a basic flex application to consume a web service (POJO exposed with axis2). Here's the WSDL:

      <wsdl:definitions xmlns:wsdl=" http://schemas.xmlsoap.org/wsdl/" xmlns:axis2=" http://ws.apache.org/axis2" xmlns:mime=" http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http=" http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0=" http://webservices.emailcenter.pas/xsd" xmlns:soap12=" http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1=" http://org.apache.axis2/xsd" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace=" http://ws.apache.org/axis2">
      <wsdl:types>
      <xs:schema xmlns:ns=" http://webservices.emailcenter.pas/xsd" targetNamespace=" http://webservices.emailcenter.pas/xsd" elementFormDefault="unqualified" attributeFormDefault="unqualified">
      <xs:element name="getTime">
      <xs:complexType />
      </xs:element>
      <xs:element name="getTimeResponse">
      <xs:complexType>
      <xs:sequence>
      <xs:element type="xs:string" name="return" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      </wsdl:types>
      <wsdl:message name="getTimeMessage">
      <wsdl:part element="ns0:getTime" name="part1" />
      </wsdl:message>
      <wsdl:message name="getTimeResponse">
      <wsdl:part element="ns0:getTimeResponse" name="part1" />
      </wsdl:message>
      <wsdl:portType name="SimpleServicePortType">
      <wsdl:operation name="getTime">
      <wsdl:input message="axis2:getTimeMessage" />
      <wsdl:output message="axis2:getTimeResponse" />
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding type="axis2:SimpleServicePortType" name="SimpleServiceSOAP11Binding">
      <soap:binding style="document" transport=" http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="getTime">
      <soap:operation style="document" soapAction="urn:getTime" />
      <wsdl:input>
      <soap:body namespace=" http://ws.apache.org/axis2" use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap:body namespace=" http://ws.apache.org/axis2" use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:binding type="axis2:SimpleServicePortType" name="SimpleServiceSOAP12Binding">
      <soap12:binding style="document" transport=" http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="getTime">
      <soap12:operation style="document" soapAction="urn:getTime" />
      <wsdl:input>
      <soap12:body namespace=" http://ws.apache.org/axis2" use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap12:body namespace=" http://ws.apache.org/axis2" use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:binding type="axis2:SimpleServicePortType" name="SimpleServiceHttpBinding">
      <http:binding verb="POST" />
      <wsdl:operation name="getTime">
      <http:operation location="getTime" />
      <wsdl:input>
      <mime:content type="text/xml" />
      </wsdl:input>
      <wsdl:output>
      <mime:content type="text/xml" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="SimpleService">
      <wsdl:port binding="axis2:SimpleServiceSOAP11Binding" name="SimpleServiceSOAP11port0">
      <soap:address location=" http://10.1.1.149:8080/axis2/services/SimpleService" />
      </wsdl:port>
      <wsdl:port binding="axis2:SimpleServiceSOAP12Binding" name="SimpleServiceSOAP12port0">
      <soap12:address location=" http://10.1.1.149:8080/axis2/services/SimpleService" />
      </wsdl:port>
      <wsdl:port binding="axis2:SimpleServiceHttpBinding" name="SimpleServiceHttpport0">
      <http:address location=" http://10.1.1.149:8080/axis2/rest/SimpleService" />
      </wsdl:port>
      </wsdl:service>



      the code for my application is very simple and straightforward:



      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="ss.getTime()">

      <mx:WebService id="ss" wsdl=" http://10.1.1.149:8080/EmailCenter/services/SimpleService?wsdl">
      <mx:operation name="getTime"/>
      </mx:WebService>

      <mx:DataGrid dataProvider="{ss.getTime.lastResult}"></mx:DataGrid>

      </mx:Application>



      when I try to consume this in my flex application I keep getting the following error:



      [RPC Fault faultString="Required parameter 'getTime' not found in input arguments." faultCode="Client.Input" faultDetail="null"]
      at mx.rpc.soap::Operation/mx.rpc.soap:Operation::createFaultEvent()
      at mx.rpc.soap::Operation/ http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()
      at mx.rpc.soap::Operation/ http://www.adobe.com/2006/flex/mx/internal::invokeAllPending()
      at mx.rpc.soap::WebService/::unEnqueueCalls()
      at mx.rpc.soap::WebService/ http://www.adobe.com/2006/flex/mx/internal::wsdlHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc.soap::WSDLParser/dispatchEvent()
      at mx.rpc.soap::WSDLParser/::parseCompleted()
      at mx.rpc.soap::WSDLParser/ http://www.adobe.com/2006/flex/mx/internal::httpResultHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::resultHandler()
      at mx.rpc::Responder/result()
      at mx.rpc::AsyncRequest/acknowledge()
      at ::DirectHTTPMessageResponder/completeHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::onComplete()


      Any advice anyone could give would be wonderful. I'm pretty new at this flex stuff but I feel like the problem may be with my WSDL?