Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Web Service Method and Parameters Detection in a JavaScript Transformer (http://www.mirthcorp.com/community/forums/showthread.php?t=7977)

mlizana 11-19-2012 04:57 AM

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

mlizana 11-21-2012 02:53 AM

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?


All times are GMT -8. The time now is 02:30 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation