Friday, October 06, 2006

Preventing empty nodes in Flash SOAP requests

Today our FLASH guru, Jason Reeves, resolved an issue we've been having with FLASH connecting to our web services. If you have been having issues connecting to Web Services using FLASH because it puts empty nodes in the SOAP requests, you may want to try this ...

Edit this file:

C:\Program Files\Macromedia\(your flash version)\(your language)\First Run\Classes\mx\services\PendingCall.as

Mx.services.PendingCall

Line 485 (or so) change this code:

var partNode = this.encodeParam(partName, partType.schemaType, elementNode, qname);
if (partObj != undefined)
this.encodeParamValue(partObj, partType.schemaType, partNode, document);

To this code:

if (partObj != undefined) {
var partNode = this.encodeParam(partName, partType.schemaType, elementNode, qname);
this.encodeParamValue(partObj, partType.schemaType, partNode, document);
}

Now when you use a webServiceConnector (or SOAP or WebService classes), flash will not add empty nodes to the request
SOAP envelope (which causes some web services to fail)!!!!!

ENJOY!

No comments:

Post a Comment