Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Custom response in Webservice Listener (http://www.mirthcorp.com/community/forums/showthread.php?t=8277)

mgorrizm 02-04-2013 04:45 AM

Custom response in Webservice Listener
 
Hi,
How can I change the SOAP envelope in the webservice listener response?

I send something like that <return>hello world<return> and I need to replace return by <MesOut>hello world</MesOut>.

I tried to put the code u can see below, in a java class that extends acceptMessage, but didn't make nothing.

@WebMethod(operationName = "S044")
public String S044(@WebParam(mode=Mode.IN,name="MesIn",targetNam espace="http://MGM.Servicios/") String messageIn,@WebParam(mode=Mode.OUT,name="MesOut",targetNamesp ace="http://MGM.Servicios/") Holder<String> messageOut) {
return webServiceMessageReceiver.processData(messageIn.to String());
}

I know the class is included correctly because the parameter MesIn work OK.

Also I want to know how I can recieve a XML that's not send as a String.(The webservice only recieve a null)

Thanks for the help.

mlizana 02-04-2013 10:37 PM

Hi Marc! I have the same problem, trying to send customized responses in a web service call. You can check my threads about it, but I still can't find a solution

http://www.mirthcorp.com/community/f...ead.php?t=8259

Anyone knows how to solve this?

fospi 04-29-2014 08:08 AM

Quote:

Originally Posted by mgorrizm (Post 30573)
Hi,
How can I change the SOAP envelope in the webservice listener response?

I send something like that <return>hello world<return> and I need to replace return by <MesOut>hello world</MesOut>.

I tried to put the code u can see below, in a java class that extends acceptMessage, but didn't make nothing.

@WebMethod(operationName = "S044")
public String S044(@WebParam(mode=Mode.IN,name="MesIn",targetNam espace="http://MGM.Servicios/") String messageIn,@WebParam(mode=Mode.OUT,name="MesOut",targetNamesp ace="http://MGM.Servicios/") Holder<String> messageOut) {
return webServiceMessageReceiver.processData(messageIn.to String());
}

I know the class is included correctly because the parameter MesIn work OK.

Also I want to know how I can recieve a XML that's not send as a String.(The webservice only recieve a null)

Thanks for the help.

Just put:

<!CDATA[[

Between the argument value inside.web service calling and finish it with:

]]>

beverlys 10-17-2014 07:05 AM

mgorrizm,

It looks like you need to set messageOut's value to something. For instance:

@WebMethod(operationName = "S044")
public String S044(@WebParam(mode=Mode.IN,name="MesIn",targetNam espace="http://MGM.Servicios/") String messageIn,@WebParam(mode=Mode.OUT,name="MesOut",ta rgetNamespace="http://MGM.Servicios/") Holder<String> messageOut) {
messageOut.value = messageIn.toString();
return webServiceMessageReceiver.processData(messageIn.to String());
}


Please see http://tomee.apache.org/examples-tru...er/README.html for more info.


All times are GMT -8. The time now is 05:03 AM.

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