|
#1
|
|||
|
|||
|
Hi,
I am trying to convert a sample of mine but I think I am missing something. The docs are talking about the configuration of the services in services-config.xml and remoting-config.xml. The remoting.xml can be pretty much left with some defaults. You do not have to configure the destinations. In the log files I can see this going for the server side. I see that the configured classes are used. However, I am having some problems at the client. There I cannot find the destinations. Am I doing something wrong? Should I now configure the client differently from the server? Following my code for the configuration, the commented part is the bean now exposed using the spring integration. Code:
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<!--<destination id="bookManager">-->
<!--<properties>-->
<!--<factory>spring</factory>-->
<!--<source>bookManager</source>-->
<!--</properties>-->
<!--</destination>-->
<destination id="authenticationHelper">
<properties>
<source>nl.gridshore.samples.books.web.security.AuthenticationHelper</source>
</properties>
</destination>
</service>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="remoteBookManager"/>
<destination id="authenticationHelper">
<properties>
<source>nl.gridshore.samples.books.web.security.AuthenticationHelper</source>
</properties>
</destination>
</service>
Am I right? Jettro Last edited by jettro; Dec 23rd, 2008 at 04:01 AM. |
|
#2
|
|||
|
|||
|
Quote:
It should definitely work without having to add Code:
<destination id="remoteBookManager"/> Are you perhaps not accessing the destination by the correct identifier? The dynamic destination is configured such that by default the id is the same as the bean id of the exporter, though that is configurable via the serviceId property of the exporter.
__________________
Jeremy Grelle Senior Software Engineer, Web Products Team SpringSource |
|
#3
|
|||
|
|||
|
Yes I mean from code, I do create the services programmatically. I did manage to get it working with a custom build channelset. It seems the client does not know how to connect to the destination because the client does not know it.
Code:
public class BookService extends RemoteService {
public function BookService(channelSet:ChannelSet) {
super("bookService", "remoteBookManager",channelSet);
}
}
public class RemoteService {
protected var remoteObject:RemoteObject;
public function RemoteService(id:String, destination:String, channelSet:ChannelSet) {
this.remoteObject = new RemoteObject(id);
this.remoteObject.destination = destination;
this.remoteObject.channelSet = channelSet;
this.remoteObject.addEventListener(FaultEvent.FAULT,onRemoteException);
}
}
I'll do some more experimentation to nail this one doen Quote:
|
|
#4
|
|||
|
|||
|
Ahh, okay I see. Yes, I do think assigning the ChannelSet to the RemoteObject is the key there. I don't think there's any getting around that when using dynamic destinations.
See here: http://livedocs.adobe.com/blazeds/1/...econfig_1.html Though I believe if you have "my-amf" set up as an application-wide default, it would work without needing to explicitly specify the ChannelSet. For example, from the services-config.xml in the BlazeDS sample: Code:
<services>
<service class="flex.samples.DatabaseCheckService" id="hsqldb" />
<service-include file-path="remoting-config.xml" />
<service-include file-path="proxy-config.xml" />
<service-include file-path="messaging-config.xml" />
<service class="flex.samples.runtimeconfig.EmployeeRuntimeRemotingDestination" id="runtime-employee-ro" />
<!--
Application level default channels. Application level default channels are
necessary when a dynamic destination is being used by a service component
and no ChannelSet has been defined for the service component. In that case,
application level default channels will be used to contact the destination.
-->
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</services>
__________________
Jeremy Grelle Senior Software Engineer, Web Products Team SpringSource |
|
#5
|
|||
|
|||
|
I have a similar issue here. I have configured the server as suggested. But, when i make a call from the client i get the following error:
Code:
message='Destination 'loginService' either does not exist or the destination has no channels defined remoting-service Code:
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</service>
services-config.xml Code:
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http : / / {server.name}:{server.port}/{context.root}/spring/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
Spring beans Code:
<bean id="loginServiceController" class="org.phoenix.core.LoginService" /> <bean id="loginService" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter"> <property name="service" ref="loginServiceController"/> <property name="messageBroker" ref="messageBrokerFactory"/> </bean> |
|
#6
|
|||
|
|||
|
Not sure whether they're typos or not, but it's supposed to be remoting-config.xml (not remoting-service) and there are some spaces in the endpoint URL in the services-config.xml which may cause some unexpected behaviour.
|
|
#7
|
|||
|
|||
|
Quote:
Quote:
|
|
#8
|
|||
|
|||
|
I have a sample that I have been using for a while and I have re-written it with the blazeds spring integration. I still have the same problem as mentioned in this thread. It only works when I add an empty destination to the client side configuration. If someone has the time to try it out:
http://code.google.com/p/gridshore/s...books-overview It is all maven, so you can build it using maven, do make sure you have the M1 of the integration in you repository. You can start the application using jetty integrated with maven: cd books-web mvn clean jetty:run-war Open the link http://localhost:8080:/books-web |
|
#9
|
|||
|
|||
|
While i try the application...!!
Quote:
However, I tried by creating a channel in my code-behind and assigned that channel to my remote service. It worked. |
|
#10
|
|||
|
|||
|
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|