| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User Registriert seit: Sep 2006 Ort: Augsburg
Beiträge: 76
| [crossdomain.xml] Webservice Problem!
Hallo Leute, hab ein kleines großes Problem mit der crossdomain.xml. Ich verwende einen Webservice und einen Tomcat application Server, der auch die .swf beinhaltende Seite hostet. Wie erwartet brauchte ich sobald ich die .swf nicht mehr im Builder ausführe eine crossdomain.xml. Hab diese daraufhin in das Tomcat Root kopiert. Komischerweise funktionierte der Service daraufhin immer noch nicht. Nach einigem gebugging bin ich darauf gekommen, das er versucht die crossdomain.xml von w3c.org/crossdomain.xml zu laden???? Jemand ne Idee warum Code siehe unten: Hier mal ein Firebug Bild ![]() Hier der MXML Code Code: <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600" initialize="application1_initializeHandler(event)"
xmlns:ns1="*" width="600" height="500" applicationComplete="application1_applicationCompleteHandler(event)"
>
<fx:Script>
<![CDATA[
import controlls.PlayerSettings;
import controlls.ServerLog;
import endpointservice.fplayerendpointservice.FPlayerEndpointService;
import mx.controls.Alert;
import mx.core.Application;
import mx.events.FlexEvent;
import mx.events.PropertyChangeEvent;
import mx.managers.SystemManager;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.utils.ObjectUtil;
import mx.utils.XMLUtil;
import services.fplayerservice.FPlayerService;
import valueObjects.EndpointReferenceType;
private static const build:String = "0.1";
private var log:ServerLog = ServerLog.Instance;
private var service:FPlayerService = null;
private var fPlayerEndpointService:FPlayerEndpointService = null;
[Bindable]
private var cm:ContextMenu = new ContextMenu();
private function initCM ():void {
cm.hideBuiltInItems();
cm.customItems = new Array ();
cm.customItems.push(new ContextMenuItem(build,true));
//flash.system.Security.allowDomain("*");
//flash.system.Security.allowInsecureDomain("*");
flash.system.Security.loadPolicyFile("http://localhost:8084/XVAServer/crossdomain.xml");
//flash.system.Security.loadPolicyFile("http://localhost:8084/crossdomain.xml");
}
protected function application1_applicationCompleteHandler(event:FlexEvent):void
{
}
private function applicationStartup ():void {
PlayerSettings.startupParameters = this.parameters;
log.log(flash.system.Security.sandboxType);
var loader:Loader = new Loader();
this.fPlayerEndpointService = new FPlayerEndpointService ();
log.log("Starting Server Handshake");
log.log("Requesting Object id");
log.log(ObjectUtil.toString(PlayerSettings.startupParameters));
this.fPlayerEndpointService.addEventListener(ResultEvent.RESULT,changeListener);
this.fPlayerEndpointService.addEventListener(FaultEvent.FAULT,faultListener);
flash.system.Security.loadPolicyFile("http://localhost:8084/XVAServer/crossdomain.xml");
log.log("Calling Service");
this.fPlayerEndpointService.getEndPoint(PlayerSettings.SessionID);
}
private function faultListener (event:FaultEvent):void {
Alert.show(event.fault.toString());
}
private function changeListener (event:ResultEvent):void {
var xmlToken:XML = new XML(event.message.body);
var element:XMLList = xmlToken.children().children().children().children()[1].children();
PlayerSettings.ObjectIdToken = element;
log.log("objectId="+element.toString());
service = new FPlayerService();
service.addEventListener(ResultEvent.RESULT,serviceListener);
log.log("Requesting Layers");
service.getLayers();
}
private function serviceListener (event:ResultEvent):void {
log.log("Recieved Layers");
log.log(event.result.toString());
}
protected function application1_initializeHandler(event:FlexEvent):void
{
this.initCM();
this.applicationStartup();
}
]]>
</fx:Script>
<s:states>
<s:State name="Preloading"/>
<s:State name="Loaded"/>
</s:states>
<fx:Declarations>
<!-- Platzieren Sie nichtvisuelle Elemente (z.*B. Dienste, Wertobjekte) hier -->
</fx:Declarations>
<s:List includeIn="Preloading" x="10" y="10" width="580" height="480" dataProvider="{ServerLog.Instance.logField}"></s:List>
<s:Button label="Weiter" click="{this.fPlayerEndpointService.getEndPoint(PlayerSettings.SessionID)}" />
</s:Application> Code: <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <?xml version="1.0" encoding="UTF-8" ?> <cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd"> <allow-access-from domain="*" secure="false" to-ports="*"/> <allow-http-request-headers-from domain="*" headers="*" secure="false" /> </cross-domain-policy> |
| | |
| | #2 (permalink) |
| Perverted Hermit Registriert seit: Mar 2004 Ort: Delmenhorst
Beiträge: 11.856
|
Was ist das für ein Service, welche APIs nutzt er?
__________________ github: https://github.com/floriansalihovic/L18nExample <florian xmlns:speaker="www.beyondtellerrand.com/ffk11/speakers_sessions" xmlns:trainer="http://www.beyondtellerrand.com/ffk11/workshops" /> and @ g+ |
| | |
| | #3 (permalink) |
| Neuer User Registriert seit: Sep 2006 Ort: Augsburg
Beiträge: 76
|
Das ganze ist ein Soap Service. Der Webservice an sich funktioniert lokal aber wunderbar. Es handelt sich um die jax-ws 2.2 api. Gerade die jax-ws ist aber extrem zuverlässig denke nicht das es ein Webservice problem ist,- oder hoffe ich zumindest. Auf Flashseite benutze ich die standart libs, denke das sollte die rpc.swc sein aus dem Flex 4 Framework. App Server ist ein Tomcat 6.0.25. Weiß jemand zufällig wie die swf bestimmt in welchem verzeichnis sie liegt? Eventuell liegts ja daran. Wenns was nützt kann ich dir die wsdl auch mal schicken Ich hab auch mal die Namespaces ausgetauscht da ich das Object eh nicht benutze sondern nur die objectId brauche. Weil das ganze ein Stateful Service ist. Danke schonmal Hier mal den einen Service: Code: /**
* This is a generated class and is not intended for modification. To customize behavior
* of this service wrapper you may modify the generated sub-class of this class - FPlayerEndpointService.as.
*/
package endpointservice.fplayerendpointservice
{
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.services.wrapper.WebServiceWrapper;
import com.adobe.serializers.utility.TypeUtility;
import mx.collections.ArrayCollection;
import mx.rpc.AbstractOperation;
import mx.rpc.AsyncToken;
import mx.rpc.soap.mxml.Operation;
import mx.rpc.soap.mxml.WebService;
import mx.rpc.xml.SchemaTypeRegistry;
import valueObjects.EndpointReferenceType;
[ExcludeClass]
internal class _Super_FPlayerEndpointService extends com.adobe.fiber.services.wrapper.WebServiceWrapper
{
// Constructor
public function _Super_FPlayerEndpointService()
{
// initialize service control
_serviceControl = new mx.rpc.soap.mxml.WebService();
mx.rpc.xml.SchemaTypeRegistry.getInstance().registerCollectionClass(new QName("http://www.w3.org/2005/08/addressing", "RelatesToType"), ArrayCollection);
mx.rpc.xml.SchemaTypeRegistry.getInstance().registerCollectionClass(new QName("http://www.w3.org/2005/08/addressing", "AttributedUnsignedLongType"), ArrayCollection);
mx.rpc.xml.SchemaTypeRegistry.getInstance().registerCollectionClass(new QName("http://www.w3.org/2005/08/addressing", "AttributedQNameType"), ArrayCollection);
mx.rpc.xml.SchemaTypeRegistry.getInstance().registerCollectionClass(new QName("http://www.w3.org/2005/08/addressing", "AttributedURIType"), ArrayCollection);
var operations:Object = new Object();
var operation:mx.rpc.soap.mxml.Operation;
operation = new mx.rpc.soap.mxml.Operation(null, "getEndPoint");
operation.resultType = valueObjects.EndpointReferenceType;
operations["getEndPoint"] = operation;
_serviceControl.operations = operations;
try
{
_serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
}
catch (e: Error)
{ /* Flex 3.4 and eralier does not support the convertResultHandler functionality. */ }
_serviceControl.service = "FPlayerEndpointServiceService";
_serviceControl.port = "FPlayerEndpointServicePort";
wsdl = "http://localhost:8084/XVAServer/FPlayerEndpointService?wsdl";
model_internal::loadWSDLIfNecessary();
model_internal::initialize();
}
/**
* This method is a generated wrapper used to call the 'getEndPoint' operation. It returns an mx.rpc.AsyncToken whose
* result property will be populated with the result of the operation when the server response is received.
* To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
* You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
*
* @see mx.rpc.AsyncToken
* @see mx.rpc.CallResponder
*
* @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
*/
public function getEndPoint(ID:String) : mx.rpc.AsyncToken
{
model_internal::loadWSDLIfNecessary();
var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getEndPoint");
var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(ID) ;
return _internal_token;
}
}
} Geändert von Brei (27-08-2010 um 00:26 Uhr) |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Webservice crossdomain.xml - wann notwendig? | Fralle | Flash mit XML und Webservices | 0 | 30-10-2009 10:41 |
| Crossdomain Problem? | gajusverus | Flash Einsteiger | 3 | 19-06-2007 12:56 |
| Crossdomain-Problem | walt74 | Flash MX | 0 | 01-06-2007 12:17 |
| Zugriffsverletzung bei WebService trotz crossdomain.xml? | bamboocha | Flash mit XML und Webservices | 0 | 19-04-2006 11:26 |