Reviewers: robertvawter_google.com, Description: Some GWT users want to build GWT RPC requests themselves, e.g. via building a raw HTML form. To do this, they need to supply the RPC policy name as part of the request, just like GWT RPC normally does. How shall they get the policy name?
This patch exports the information via ServiceDefTarget. To get the policy name then looks similar to the way a the URL is set for where the RPC server lives: String policyName = ((ServiceDefTarget) GWT.create(MyRpcService.class)).getSerializationPolicyName(); Please review this at http://gwt-code-reviews.appspot.com/115805 Affected files: user/src/com/google/gwt/user/client/rpc/ServiceDefTarget.java user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java Index: user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java =================================================================== --- user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java (revision 7217) +++ user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java (working copy) @@ -212,6 +212,10 @@ clientSerializationStreamWriter.prepareToWrite(); return clientSerializationStreamWriter; } + + public String getSerializationPolicyName() { + return serializationPolicyName; + } /** * @see ServiceDefTarget#getServiceEntryPoint() Index: user/src/com/google/gwt/user/client/rpc/ServiceDefTarget.java =================================================================== --- user/src/com/google/gwt/user/client/rpc/ServiceDefTarget.java (revision 7217) +++ user/src/com/google/gwt/user/client/rpc/ServiceDefTarget.java (working copy) @@ -34,6 +34,12 @@ super("Service implementation URL not specified"); } } + + /** + * Return the strong name of the serialization policy to be used with this RPC + * instance. + */ + String getSerializationPolicyName(); /** * Gets the URL of a service implementation. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
