Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-07-2007, 05:29 PM   #1
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default SOAP and WebService

I'm trying to send SOAP requests with WebService.

WebService.loadWSDL seems to load the configuration stuff. I know I can use getOperation, then Send to send things, but the callbacks from the AsyncToken never seem to get called.

Am I doing things right? I don't want to do this with the UI XML; I want to do it in ActionScript.

I'm not sure Send is what I really want to do, and I'm not sure what the parameters are for a remote call.

Say I have
Code:
<SomeOperation xmlns="http://foo.com/file">
  <Parameter1>foo</Parameter1>
  <Parameter2>bar</Parameter2>
</SomeOperation >
the xmlns and SomeOperation part should have been parsed with loadWSDL (I think). I'm not sure how to send the parameters. I tried making XML objects with Parameter1 as the root, but I didn't get a response.

Pointers, examples, and anything else would be appreciated.

Thank you!
exobyte is offline   Reply With Quote
Old 10-08-2007, 06:00 AM   #2
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default

Update:

I can call functions and get callbacks, but the calls aren't working, yet.

To call a function, do "<webservice object>.<method name>(<parameters>);"

Callbacks are done with "<webservice object>.addEventListenter(<Event ID>, callback);"

My problem is that I keep getting faults, and the message is null, so I'm not sure how to debug it.
exobyte is offline   Reply With Quote
Old 10-08-2007, 08:03 AM   #3
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default

I grabbed Hotfix 3 for Flex 2. I know that I'm not having any cross-domain issues (same domain, and I fixed it when it was on a different domain).

Now I get this:
Code:
HTTP request error
(mx.messaging.messages::ErrorMessage)#0
  body = (Object)#1
  clientId = "DirectHTTPChannel0"
  correlationId = "C5EF8C74-6413-12CF-7737-7E8FE675B002"
  destination = ""
  extendedData = (null)
  faultCode = "Server.Error.Request"
  faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://foo.com/soap"]. URL: https://foo.com/soap"
  faultString = "HTTP request error"
  headers = (Object)#2
  messageId = "55F24685-6626-C774-F58E-7E8FE6E39495"
  rootCause = (flash.events::IOErrorEvent)#3
    bubbles = false
    cancelable = false
    currentTarget = (flash.net::URLLoader)#4
      bytesLoaded = 0
      bytesTotal = 0
      data = (null)
      dataFormat = "text"
    eventPhase = 2
    target = (flash.net::URLLoader)#4
    text = "Error #2032: Stream Error. URL: https://foo.com/soap"
    type = "ioError"
  timestamp = 0
  timeToLive = 0
I'm calling the method like this:

<webservice object>.<method>(<string parameter1>, <string parameter 2>);

Both strings are the XML strings the server expects.

Ideas?
exobyte is offline   Reply With Quote
Old 10-08-2007, 06:32 PM   #4
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default

http://bugs.adobe.com/jira/browse/SDK-11250 hmm...

If I use "_<tag>foo</tag>" I do indeed get a malformed XML error, but replacing < and > with &lt; and &gt; gives me the same error. I'm not sure what was mean by "escape," either--XML or unix \, though \ has meaning to the parser, and this is at runtime.

Passing XML arguments instead of XML strings gives me the same error.

Last edited by exobyte; 10-08-2007 at 06:49 PM.
exobyte is offline   Reply With Quote
Old 10-08-2007, 08:07 PM   #5
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default

Using the mxml version gives me the same error, so that's not it.
exobyte is offline   Reply With Quote
Old 10-09-2007, 02:22 AM   #6
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default

Using Paros (very cool tool for this stuff, might I add) I noticed a "tns:" preceding the normal XML stuff. This is what was actually sent to the server.

Code:
<tns:Command xmlns:tns="http://foo.com/path/file">
      <tns:Parameter>bar</tns:Parameter>
</tns:Command>
I don't have access to the server, but from the docs, it isn't expecting any of the "tns:" stuff.

Ideas?
exobyte is offline   Reply With Quote
Old 10-09-2007, 02:46 AM   #7
exobyte
Registered User
 
Join Date: Oct 2007
Posts: 10
Default

I found my bug. It looks like there was a server error. The message just didn't make it back to Flex.

I read about a feature request/bug about this.
exobyte is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Struggling with Flex2 WebService client ryan_m Flex 2, 3 & 4 7 05-27-2009 11:26 PM
Get Data From WebService To XML SixStrings ActionScript 2.0 2 03-30-2007 05:26 AM
Using data retrieved from SOAP. 05studios ActionScript 2.0 1 12-09-2004 08:10 PM
WebService connection closed alecswan ActionScript 2.0 0 10-26-2004 11:04 PM
Adding SOAP headers to WebService calls? MartinRandall ActionScript 2.0 0 01-19-2004 04:38 PM


All times are GMT. The time now is 10:31 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.