web stats
Web Service Method and Parameters Detection in a JavaScript Transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-19-2012, 03:57 AM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 11-21-2012, 01:53 AM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default

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?
Reply With Quote
Reply

Tags
javascript, listener, methods, parameters, webservice

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:27 AM.


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