web stats
How to use custom web service input vars in transformers? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2014, 04:38 AM
mdehoog mdehoog is offline
Mirth Guru
 
Join Date: Mar 2011
Location: Apeldoorn the Netherlands
Posts: 296
mdehoog is on a distinguished road
Send a message via Skype™ to mdehoog
Default How to use custom web service input vars in transformers?

Custom Web Service Listener
Mirth Connect 3.1
Windows 8.1
Java 8

Using Eclipse I've created a custom web service listener which contains two actions. One action just accepts two variables.

HTML Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.custom.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:add>
         <i>?</i>
         <j>?</j>
      </web:add>
   </soapenv:Body>
</soapenv:Envelope>
How can I use these vars in my transformers? Or even the complete incomming message?

Or is this not possible?

Thanks for the input.
Matthy
__________________
X Connections
https://documentor.email
https://www.x-connections.com

Last edited by mdehoog; 11-03-2014 at 04:40 AM.
Reply With Quote
  #2  
Old 11-03-2014, 06:40 AM
mdehoog mdehoog is offline
Mirth Guru
 
Join Date: Mar 2011
Location: Apeldoorn the Netherlands
Posts: 296
mdehoog is on a distinguished road
Send a message via Skype™ to mdehoog
Default

It looks like the SOAP request isnt entring the channel at all.
Even a logger.info in the preprosessor isnt triggered.
__________________
X Connections
https://documentor.email
https://www.x-connections.com
Reply With Quote
  #3  
Old 11-03-2014, 06:49 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

If you want to dispatch a message, call the processData function. In 3.1 it can take in either a string or a RawMessage object, so you can simply add those values as source map variables if you want.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #4  
Old 11-03-2014, 07:19 AM
mdehoog mdehoog is offline
Mirth Guru
 
Join Date: Mar 2011
Location: Apeldoorn the Netherlands
Posts: 296
mdehoog is on a distinguished road
Send a message via Skype™ to mdehoog
Default

I added
String response = webServiceReceiver.processData(param);

to my code but ...

Any suggestion how to implement your suggestion (raw message)?
For me"simply" is still "complex"
__________________
X Connections
https://documentor.email
https://www.x-connections.com
Reply With Quote
  #5  
Old 11-03-2014, 07:23 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Quote:
Originally Posted by mdehoog View Post
I added
String response = webServiceReceiver.processData(param);

to my code but ...

Any suggestion how to implement your suggestion (raw message)?
For me"simply" is still "complex"
There's another version of the method that takes in a RawMessage object. Look at the User API for information on how to construct one.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #6  
Old 11-03-2014, 07:53 AM
mdehoog mdehoog is offline
Mirth Guru
 
Join Date: Mar 2011
Location: Apeldoorn the Netherlands
Posts: 296
mdehoog is on a distinguished road
Send a message via Skype™ to mdehoog
Default

I take the challenge.
__________________
X Connections
https://documentor.email
https://www.x-connections.com
Reply With Quote
Reply

Tags
custom web service, variables

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 08:08 AM.


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