0 Replies Latest reply on May 21, 2007 12:00 PM by FUNUI

    Trying to invoke HTTPService with SOAP request

    FUNUI
      Hi all,
      I have been trying to invoke a HTTPService with a SOAP request. Most of the times I get an error saying that the client has invoked HTTP with get instead of a POST eventhough my code takes care of it. Any clue on this? I have copied the code snippet below which has the SOAP request in a variable message.

      <?xml version="1.0"?><!-- fds\rpc\WebServiceAddHeader.mxml -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" height="628" width="924">
      <mx:Script>
      <![CDATA[
      import mx.messaging.messages.HTTPRequestMessage;
      import mx.messaging.messages.SOAPMessage;

      var message:SOAPMessage = new SOAPMessage();
      public var msg:HTTPRequestMessage = new HTTPRequestMessage();

      public function headers():void {
      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_SOAP_XML;
      msg.method = HTTPRequestMessage.POST_METHOD;
      msg.url = " http://ldlt7316.wellsfargo.com:8016/hulaweb/FrameworkServletListener";
      msg.body = <SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:msg=" http://service.wellsfargo.com/entity/message/2003/" xmlns:hcfg=" http://service.wellsfargo.com/provider/HCFG/entity/envelope/2004/"><SOAP-ENV:Header><msg:W FContext><msg:messageId>1175034929937</msg:messageId><msg:sessionSequenceNumber>1</msg:ses sionSequenceNumber><msg:creationTimestamp>2007-03-27T04:35:29-0600</msg:creationTimestamp> <msg:originatorId>aow</msg:originatorId><msg:initiatorId>AOW</msg:initiatorId></msg:WFCont ext><hcfg:hulaContext><service>ApplicationDataService</service><action>getApplicationByDea lID</action><msg:processingMode>sync</msg:processingMode><contextType>SERVICE_REQUEST</con textType><password>PASSWORD123</password><msg:behaviorVersion>1</msg:behaviorVersion></hcf g:hulaContext></SOAP-ENV:Header><SOAP-ENV:Body><ns:getLendingData xmlns:ns=" http://service.wellsfargo.com/provider/HCFG/common/lendingDataTransfer/getLendingData/2006 /"><servicePreferences><ns1:maximumWaitTime xmlns:ns1=" http://service.wellsfargo.com/provider/HCFG/entity/common/2004/">600</ns1:maximumWaitTime> <ns1:maxReturn xmlns:ns1=" http://service.wellsfargo.com/entity/message/2003/">10</ns1:maxReturn></servicePreferences ><lendingTransaction><transactionDetail>
      <ns1:dealId xmlns:ns1=" http://service.wellsfargo.com/provider/HCFG/entity/transactionDetail/2005/">
      323010
      </ns1:dealId></transactionDetail></lendingTransaction></ns:getLendingData></SOAP-ENV:Body ></SOAP-ENV:Envelope>
      ;

      soapCall.request = msg;
      soapCall.method = "POST";
      soapCall.send();
      }


      ]]>
      </mx:Script>
      <mx:HTTPService
      id="soapCall"
      resultFormat="xml"
      method="post"
      showBusyCursor="true"
      makeObjectsBindable="false"
      useProxy="false"
      requestTimeout="120"
      url=" http://ldlt7316.wellsfargo.com:8016/hulaweb/FrameworkServletListener"
      request="{msg}">
      </mx:HTTPService>


      <mx:Panel layout="absolute" title="{soapCall.lastResult}" id="blog" fontFamily="Courier New">
      <mx:DataGrid x="15" y="10" id="dgPosts" width="482" dataProvider="{soapCall.lastResult}" height="108">
      <mx:columns>
      <mx:DataGridColumn headerText="Name" dataField="code"/>
      <mx:DataGridColumn headerText="Dates" dataField="lastName"/>
      </mx:columns>
      </mx:DataGrid>
      <mx:LinkButton label="Get Data" click="headers()"/>
      <mx:TextArea x="15" y="145" width="782" fontSize="9" fontFamily="Verdana" borderStyle="inset" htmlText="{soapCall.lastResult}" height="379"/>
      </mx:Panel>

      </mx:Application>