<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Actionscript 3 and SOAP Webservices</title>
	<atom:link href="http://vevmedia.net/blog/actionscript-3-and-soap-webservices/feed/" rel="self" type="application/rss+xml" />
	<link>http://vevmedia.net/blog/actionscript-3-and-soap-webservices/</link>
	<description>If we don&#039;t change direction soon, we&#039;ll end up where we&#039;re going.</description>
	<lastBuildDate>Tue, 27 Jul 2010 00:43:29 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Noel</title>
		<link>http://vevmedia.net/blog/actionscript-3-and-soap-webservices/comment-page-1/#comment-484</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Mon, 19 Apr 2010 13:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://vevmedia.net/blog/?p=872#comment-484</guid>
		<description>Hello, looking to communicate with a web service and found this site. Very useful but how do you send an XML SOAP request to the web service?</description>
		<content:encoded><![CDATA[<p>Hello, looking to communicate with a web service and found this site. Very useful but how do you send an XML SOAP request to the web service?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vevmesteren</title>
		<link>http://vevmedia.net/blog/actionscript-3-and-soap-webservices/comment-page-1/#comment-469</link>
		<dc:creator>vevmesteren</dc:creator>
		<pubDate>Wed, 24 Mar 2010 17:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://vevmedia.net/blog/?p=872#comment-469</guid>
		<description>Awesome thanks my own favorite Design Pattern book : http://www.as3dp.com/ the site for &lt;a href=&quot;http://books.google.com/books?id=lgk0Q7pMmLYC&amp;dq=actionscript+3.0+design+patterns&amp;printsec=frontcover&amp;source=bn&amp;hl=en&amp;ei=l02qS-nyIYOC8gbRyvy8Bw&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=6&amp;ved=0CCIQ6AEwBQ#v=onepage&amp;q=&amp;f=false&quot; rel=&quot;nofollow&quot;&gt;this book&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Awesome thanks my own favorite Design Pattern book : <a href="http://www.as3dp.com/" rel="nofollow">http://www.as3dp.com/</a> the site for <a href="http://books.google.com/books?id=lgk0Q7pMmLYC&amp;dq=actionscript+3.0+design+patterns&amp;printsec=frontcover&amp;source=bn&amp;hl=en&amp;ei=l02qS-nyIYOC8gbRyvy8Bw&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=6&amp;ved=0CCIQ6AEwBQ#v=onepage&amp;q=&amp;f=false" rel="nofollow">this book</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://vevmedia.net/blog/actionscript-3-and-soap-webservices/comment-page-1/#comment-468</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 24 Mar 2010 17:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://vevmedia.net/blog/?p=872#comment-468</guid>
		<description>Suggested reading:
Advanced ActionScript 3 with Design Patterns
by Joey Lott and Danny Patterson
Go to chapter 15 for a better and complete solution.



My example code:
private var xmlResults:XML = new URLLoader;
private var urlLoader:URLLoader = new URLLoader();


public function fErrorHandler(e:IOErrorEvent):void {
			trace(&quot;xml failed!&quot;);
        }

        
//when the &quot;loader&quot; event object finishes the loading of the xml file, run other needed functions to process the data	
private function fLoaderCompleteHandler(event:Event):void {
			
			trace(&quot;xml loaded!!&quot;); //jwt testing
			var result2:XML = new XML(urlLoader.data); // loads the xml file data into the xml object
			xmlResults = result2; //have the global xml object equal the current data loaded xml object 
			result2 = null; // dont need current xml object any more so erase it
			
			fParseXML(0); //process the first set of records from the xml object
			trace(&quot;found xml&quot; + xmlResults.toString()); 
        } 
		
		
public function fParseXML(intAddNum:Number):void{
			//create variables to store the record info
			//
			var envelope:XML = xmlResults; //XML(urlLoader.data);
			var soap:Namespace = envelope.namespace(&quot;soap&quot;);
			var responseN:Namespace = new Namespace(&quot;http://www.domain.com/school/ServiceCollege&quot;);
			var resultL:XMLList = envelope.soap::Body.responseN::HelloTestResponse.responseN::HelloTestResult;
			
			var strTest:String;
			//if only one response field will be return by the web service
			strTest = resultL; 
			//do something like this if multiple  response feilds will be returned
			//strTest = resultL.response::schoolName.toString(); 
			trace(&quot;parsing:&quot; + strTest);
			trace(&quot;done loading:&quot;);
		}
		
		
	public function fBeginRequest():void{
		var strXMLDataRequest:String
		var urlRequest:URLRequest = new URLRequest();
		urlRequest.contentType = &quot;text/xml; charset=utf-8&quot;;
		urlRequest.method = &quot;POST&quot;;
		urlRequest.url = &quot;http://www.domain.com/school/serviceCollege.asmx&quot;;  
		var soapAction:URLRequestHeader = new URLRequestHeader(&quot;SOAPAction&quot;,&quot;http://www.domain.com/school/ServiceCollege/HelloTest&quot;);
		urlRequest.requestHeaders.push(soapAction);
		strXMLDataRequest = &quot;&lt;soap:Envelope xmlns:xsi=\&quot;http://www.w3.org/2001/XMLSchema-instance\&quot; xmlns:xsd=\&quot;http://www.w3.org/2001/XMLSchema\&quot; xmlns:soap=\&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot;&gt;&quot;;
			strXMLDataRequest = strXMLDataRequest + &quot;&lt;soap:Body&gt;&quot;;
			strXMLDataRequest = strXMLDataRequest + &quot;&lt;HelloTest xmlns=\&quot;http://www.domain.com/school/ServiceCollege\&quot; /&gt;&quot;;
			strXMLDataRequest = strXMLDataRequest + &quot;&lt;/soap:Body&gt;&quot;;
			strXMLDataRequest = strXMLDataRequest + &quot;&lt;/soap:Envelope&gt;&quot;;
		  urlRequest.data =  new XML(strXMLDataRequest);
	    urlLoader.load(urlRequest);
      urlLoader.addEventListener(IOErrorEvent.IO_ERROR, fErrorHandler); //add the event to the &quot;loader&quot; object
      urlLoader.addEventListener(Event.COMPLETE, fLoaderCompleteHandler); //add the event to the &quot;loader&quot; object
	}


Soap Request:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
  &lt;soap:Body&gt;
    &lt;HelloTest xmlns=&quot;http://www.domain.com/school/ServiceCollege&quot; /&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;


Soap Response:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
  &lt;soap:Body&gt;
    &lt;HelloTestResponse xmlns=&quot;http://www.domain.com/school/ServiceCollege&quot;&gt;
      &lt;HelloTestResult&gt;string
    &lt;/HelloTestResponse&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</description>
		<content:encoded><![CDATA[<p>Suggested reading:<br />
Advanced ActionScript 3 with Design Patterns<br />
by Joey Lott and Danny Patterson<br />
Go to chapter 15 for a better and complete solution.</p>
<p>My example code:<br />
private var xmlResults:XML = new URLLoader;<br />
private var urlLoader:URLLoader = new URLLoader();</p>
<p>public function fErrorHandler(e:IOErrorEvent):void {<br />
			trace(&#8220;xml failed!&#8221;);<br />
        }</p>
<p>//when the &#8220;loader&#8221; event object finishes the loading of the xml file, run other needed functions to process the data<br />
private function fLoaderCompleteHandler(event:Event):void {</p>
<p>			trace(&#8220;xml loaded!!&#8221;); //jwt testing<br />
			var result2:XML = new XML(urlLoader.data); // loads the xml file data into the xml object<br />
			xmlResults = result2; //have the global xml object equal the current data loaded xml object<br />
			result2 = null; // dont need current xml object any more so erase it</p>
<p>			fParseXML(0); //process the first set of records from the xml object<br />
			trace(&#8220;found xml&#8221; + xmlResults.toString());<br />
        } </p>
<p>public function fParseXML(intAddNum:Number):void{<br />
			//create variables to store the record info<br />
			//<br />
			var envelope:XML = xmlResults; //XML(urlLoader.data);<br />
			var soap:Namespace = envelope.namespace(&#8220;soap&#8221;);<br />
			var responseN:Namespace = new Namespace(&#8220;http://www.domain.com/school/ServiceCollege&#8221;);<br />
			var resultL:XMLList = envelope.soap::Body.responseN::HelloTestResponse.responseN::HelloTestResult;</p>
<p>			var strTest:String;<br />
			//if only one response field will be return by the web service<br />
			strTest = resultL;<br />
			//do something like this if multiple  response feilds will be returned<br />
			//strTest = resultL.response::schoolName.toString();<br />
			trace(&#8220;parsing:&#8221; + strTest);<br />
			trace(&#8220;done loading:&#8221;);<br />
		}</p>
<p>	public function fBeginRequest():void{<br />
		var strXMLDataRequest:String<br />
		var urlRequest:URLRequest = new URLRequest();<br />
		urlRequest.contentType = &#8220;text/xml; charset=utf-8&#8243;;<br />
		urlRequest.method = &#8220;POST&#8221;;<br />
		urlRequest.url = &#8220;http://www.domain.com/school/serviceCollege.asmx&#8221;;<br />
		var soapAction:URLRequestHeader = new URLRequestHeader(&#8220;SOAPAction&#8221;,&#8221;http://www.domain.com/school/ServiceCollege/HelloTest&#8221;);<br />
		urlRequest.requestHeaders.push(soapAction);<br />
		strXMLDataRequest = &#8220;&lt;soap:Envelope xmlns:xsi=\&#8221;http://www.w3.org/2001/XMLSchema-instance\&#8221; xmlns:xsd=\&#8221;http://www.w3.org/2001/XMLSchema\&#8221; xmlns:soap=\&#8221;http://schemas.xmlsoap.org/soap/envelope/\&#8221;&gt;&#8221;;<br />
			strXMLDataRequest = strXMLDataRequest + &#8220;&lt;soap:Body&gt;&#8221;;<br />
			strXMLDataRequest = strXMLDataRequest + &#8220;&lt;HelloTest xmlns=\&#8221;http://www.domain.com/school/ServiceCollege\&#8221; /&gt;&#8221;;<br />
			strXMLDataRequest = strXMLDataRequest + &#8220;&lt;/soap:Body&gt;&#8221;;<br />
			strXMLDataRequest = strXMLDataRequest + &#8220;&lt;/soap:Envelope&gt;&#8221;;<br />
		  urlRequest.data =  new XML(strXMLDataRequest);<br />
	    urlLoader.load(urlRequest);<br />
      urlLoader.addEventListener(IOErrorEvent.IO_ERROR, fErrorHandler); //add the event to the &#8220;loader&#8221; object<br />
      urlLoader.addEventListener(Event.COMPLETE, fLoaderCompleteHandler); //add the event to the &#8220;loader&#8221; object<br />
	}</p>
<p>Soap Request:<br />
&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;soap:Envelope xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:soap=&#8221;http://schemas.xmlsoap.org/soap/envelope/&#8221;&gt;<br />
  &lt;soap:Body&gt;<br />
    &lt;HelloTest xmlns=&#8221;http://www.domain.com/school/ServiceCollege&#8221; /&gt;<br />
  &lt;/soap:Body&gt;<br />
&lt;/soap:Envelope&gt;</p>
<p>Soap Response:<br />
&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;soap:Envelope xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:soap=&#8221;http://schemas.xmlsoap.org/soap/envelope/&#8221;&gt;<br />
  &lt;soap:Body&gt;<br />
    &lt;HelloTestResponse xmlns=&#8221;http://www.domain.com/school/ServiceCollege&#8221;&gt;<br />
      &lt;HelloTestResult&gt;string<br />
    &lt;/HelloTestResponse&gt;<br />
  &lt;/soap:Body&gt;<br />
&lt;/soap:Envelope&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

