Announcement

Collapse
No announcement yet.

Web Service Method and Parameters Detection in a JavaScript Transformer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web Service Method and Parameters Detection in a JavaScript Transformer

    Hi, I developed a custom web service in a Web Service Listener Connector, for instance:

    Code:
    public String method1(String param1, int param2);
    public String method2(String param1);
    And when I receive something, I create a transformer that process the message... but I have questions about it:

    1) How can I know, in a javascript transformer, which method is called in the webservice? I mean, if the web service has more than 1 method, I want to detect which is the method called.

    2) How can access to a concrete parameter in a web service method call that has more than 1 parameter?

    Thanks in advance

  • #2
    The first attempt to solve the problem that works is to put the ID of the method inside the message...

    Code:
    	
    @WebMethod
    public String method1(String message) {
            return webServiceMessageReceiver.processData("<message><method>METHOD1</method>"+message+"</message>");
    }
    With this, I can identify which method is called in the web service... but I think it's not the better solution... any ideas?

    Comment

    Working...
    X