Re-hello,
 
No answers?
 
I wonder if I use Java Reflection (with setter methods) of stubs to fill input parameter object (for complex type).
OR
Use jaxme (or xstream) to manipulate XML stream. Set attributes to correct values and generated from the XML stream the appropriate object.
 
Somebody can give an opinion or its experience about this solution?
 
Thanks a lot.
 
Delphine.
 
-----------------------------------------------------------------
Hello everybody,
 
 
I use WSIF to invoke dynamically a Web Service:
 
I try this:
 
1 - Get the WSDL endpoint, operation name .... To call. My operation
take a complex type (new Person(name,firstname)) as input parameter and
return a String (hello <name> <firstname>)
 
2 - Generate in fly Java Stubs using Axis 1.2.1
 
3 - Get the dynamic class (from a ClassLoader class), fill this
instantiated object with setters methods using Java Reflection
 
4 - Set this dynamic object as an input parameter
(input.setObjectPart("Person_1", dynamicObject)). (Map this type with
service.mapType function)
 
5 - Call the WSIF executeRequestResponseOperation method.
 
It's works fine.
 
 
 
Now, I want to do the step 3 dynamically. Use Java Reflection to set all
the fields correctly with the user input value it's quiet complicated I
think.
 
 
 
So, I wonder whether with xstream API it will be easier.
 
1 - Get the WSDL endpoint, operation name .... 
 
2 - Generate in fly Java Stubs using Axis 1.2.1
 
3 - Get the dynamic class (from a ClassLoader class) of the input part
of the operation and generate the XML stream using xtream API
 
4 - Represent this XML stream as a JTree for the user who fill this. And
with this XML stream which is filled with user values, deserialize the
object back from the XML using xstream.
 
5 - Set the object generated by xstream as an input parameter
(input.setObjectPart("Person_1", xstreamGeneratedObject))
 
6 - Call the WSIF executeRequestResponseOperation method
 
 
 
Is somebody have already try this? (or a similar solution?)
 
 
 
I try to generate the XML stream from the stub generated by Axis, but
the fields are not initialized with default value. So, the XML stream is
empty.
 
For example, if I can get a Java Stubs from Axis like this (with a
default constructor which init nom and prenom to "" ):
 
 
 
package stubs.MyHelloServiceDme;
 
 
 
public class HelloObj  implements java.io.Serializable {
 
    private java.lang.String nom;
 
    private java.lang.String prenom;
 
 
 
    public HelloObj() {
 
      this.nom="";
 
      this.prenom="";
 
    }
 
 
 
    public java.lang.String getNom() {
 
        return nom;
 
    }
 
 
 
I can get the XML stream:
 
 
 
<stubs.MyHelloServiceDme.HelloObj>
 
  <nom></nom>
 
  <prenom></prenom>
 
  <____hashCodeCalc>false</____hashCodeCalc>
 
</stubs.MyHelloServiceDme.HelloObj>
 
 
 
Then, I can fill the XML stream <nom> and  <prenom> elements, get a Java
Object from the XML stream filled, and pass it to WSIF to invoker
operation.
 
 
 
Thanks to help me.
 
 
 
Delphine.
 

 

Reply via email to