Forum Discussion

rwebb's avatar
rwebb
New Contributor
16 years ago

Why does AMF Request return ugly XML?

Hello,
In the "Tutorial for the AMF Test Step" it uses the BlazeDS turnkey sample program as an example.  The response returned in the example is nicely formatted XML:


  2
  Nokia 3100 Blue


When I am running an AMF Test Step against my own service, however, how come the XML returned looks like this:


 
 
   
      0.75
      12
   

    16
    1
    prop
    HISPROP
 

 
   
      false
      false
      com.rmtsrv.service.MyForm
   

 




How can I get the XML to be human-readable like in the example?

Sincerely,
Richard Webb

5 Replies

  • jamesrender's avatar
    jamesrender
    Occasional Contributor
    I'm also suffering with the same condition.  The problem is preventing me from writing the meaningful test conditions I'd like..

    I've tried registering the aliases as suggested, to no avail..

    is it possible to turn on some debugging, or get more information on what the deserialization process is struggling with?

    here is my script

    import flex.messaging.io.amf.client.AMFConnection;

    log.info("registering Wks aliases");
    AMFConnection.registerAlias("com.xxx.wks.comp.dao.WksDAODesktop", "com.xxx.wks.comp.dao.WksDAODesktop");
    AMFConnection.registerAlias("com.xxx.wks.comp.dao.WksDAOBook", "com.xxx.wks.comp.dao.WksDAOBook");
    AMFConnection.registerAlias("com.xxx.wks.comp.dao.WksDAOPage", "com.xxx.wks.comp.dao.WksDAOPage");
    AMFConnection.registerAlias("com.xxx.wks.comp.dao.WksDAOComp", "com.xxx.wks.comp.dao.WksDAOComp");
    AMFConnection.registerAlias("com.xxx.wks.comp.dao.WksDAOCompType", "com.xxx.wks.comp.dao.WksDAOCompType");
    log.info("registering Wks aliases.. done");

    jar file has been dropped into place, and I can see the log message saying its loaded..
  • rwebb's avatar
    rwebb
    New Contributor
    I added the Groovy script from the other thread and it did not work.  Here is what I did:

    Added the following script:
    import flex.messaging.io.amf.client.AMFConnection;
    AMFConnection.registerAlias( "tutorial.Product", "Product" );

    My Java class is the Product class in the tutorial package.  I added a JAR containing this class to %SOAPUI%\bin\ext, restarted SoapUI, and made sure the log showed the JAR was added to the classpath.

    My Flex class is the Product class in the default (no) package.  Is this supposed to be in a JAR too?  I added the source - Product.as - to the same JAR as the Java class and it didn't seem to affect anything.  (I of course restarted SoapUI.)  Is there anything else I should be doing?

    Thank you,
    Richard Webb
  • jamesrender's avatar
    jamesrender
    Occasional Contributor
    bump, could have some help please, I've created another AMFTestCase and am unable to marshal back to a testable object:

    have created the script, and added the java jar to the classpath

    tried registering the alias both ways :S

    Using script:

    import flex.messaging.io.amf.client.AMFConnection;

    log.info("registering aliases");
    AMFConnection.registerAlias("com.xxx.ibtcp.cpp.ui.model.InvocableAction", "com.xxx.cp.odx.model.vo.InvocableAction");
    AMFConnection.registerAlias("com.xxx.cp.odx.model.vo.InvocableAction", "com.xxx.ibtcp.cpp.ui.model.InvocableAction");
    log.info("registering aliases.. done");
  • jamesrender's avatar
    jamesrender
    Occasional Contributor
    Sorry to bump, still having difficulties marshalling back to usable Java objects..

    is there any way I can investigate the `unserializable` nature of my amf responses.. 

    looking in the blazeds junits there appears to be a way to turn on amf tracing.. (working on the presumption that you are using AMFConnection

    please see: testSetGetAMFTrace()

    http://opensource.adobe.com/svn/opensou ... nTest.java