web stats
XDS.b Listener Response - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2019, 05:03 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 245
mcalKno is on a distinguished road
Default XDS.b Listener Response

We have an XDS.b listener setup and it receives the message from the source sender without issue, but they are expecting a different response back. I've tried modifying the response for a custom option, but it doesn't seem to change the response we issue to the source sender.

Response being sent:
PHP Code:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
    <
env:Header>
        <
wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
        
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-bResponse</wsa:Action>
        <
wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">urn:uuid:2f7000c3-919e-4a14-8b6c-5acef7c13e3f</wsa:MessageID>
        <
wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:31862be8-8928-4575-83ed-aeca7c7eaa87</wsa:RelatesTo>
    </
env:Header>
    <
env:Body>
        <
env:Message>Successfully received message.</env:Message>
    </
env:Body>
</
env:Envelope
Expected Response:
PHP Code:
<SOAP-ENV:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
  <
SOAP-ENV:Header>
    <
wsa:Action SOAP-ENV:mustUnderstand="true">urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-bResponse</wsa:Action>
    <
wsa:MessageID>urn:uuid:EE1B78BB-A714-4A14-B66A-3B1538DD24CA</wsa:MessageID>
    <
wsa:RelatesTo>urn:uuid:e48a8ad9-4677-4d80-8a99-5b9aab97eac6</wsa:RelatesTo>
    <
wsa:To>http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
  
</SOAP-ENV:Header>
  <
SOAP-ENV:Body>
    <
RegistryResponse status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success" xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" />
  </
SOAP-ENV:Body>
</
SOAP-ENV:Envelope
Reply With Quote
  #2  
Old 03-13-2019, 09:14 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,082
narupley is on a distinguished road
Default

That is the default response that gets sent back if no actual response is selected. What do you have the Response drop-down menu set to in the Source Settings on the Source tab? And how are you creating that response?
__________________
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
  #3  
Old 03-13-2019, 09:47 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 245
mcalKno is on a distinguished road
Default

Thanks, Nick! I've attached 2 screen shots, but since building out this customResp, I'm getting errors....

PHP Code:
[2019-03-13 01:36:15,841]  ERROR  (com.mirth.connect.connectors.interop.xdsb.server.XDSBReceiver:214): Failed to convert JSON to XML
javax
.xml.stream.XMLStreamExceptionjava.io.IOExceptionIllegal character: <<>
    
at de.odysseus.staxon.base.AbstractXMLStreamReader.initialize(AbstractXMLStreamReader.java:218)
    
at de.odysseus.staxon.json.JsonXMLStreamReader.initialize(JsonXMLStreamReader.java:87)
    
at de.odysseus.staxon.json.JsonXMLStreamReader.<init>(JsonXMLStreamReader.java:78)
    
at com.mirth.connect.util.JsonXmlUtil$NormalizeXMLStreamReader.<init>(JsonXmlUtil.java:401)
    
at com.mirth.connect.util.JsonXmlUtil$NormalizeXMLInputFactory.createXMLStreamReader(JsonXmlUtil.java:389)
    
at com.mirth.connect.util.JsonXmlUtil.jsonToXml(JsonXmlUtil.java:105)
    
at com.mirth.connect.util.JsonXmlUtil.jsonToXml(JsonXmlUtil.java:99)
    
at com.mirth.connect.connectors.interop.server.InteropReceiver.sendResponse(InteropReceiver.java:211)
    
at com.mirth.connect.connectors.http.HttpReceiver$RequestHandler.handle(HttpReceiver.java:384)
    
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
    
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:205)
    
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
    
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    
at org.eclipse.jetty.server.Server.handle(Server.java:531)
    
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
    
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
    
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
    
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
    
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
    
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:319)
    
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:175)
    
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:139)
    
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754)
    
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:672)
    
at java.lang.Thread.run(Unknown Source)Caused byjava.io.IOExceptionIllegal character: <<>
    
at de.odysseus.staxon.json.stream.impl.Yylex.yylex(Yylex.java:641)
    
at de.odysseus.staxon.json.stream.impl.Yylex.nextSymbol(Yylex.java:271)
    
at de.odysseus.staxon.json.stream.impl.JsonStreamSourceImpl.next(JsonStreamSourceImpl.java:107)
    
at de.odysseus.staxon.json.stream.impl.JsonStreamSourceImpl.peek(JsonStreamSourceImpl.java:250)
    
at de.odysseus.staxon.json.JsonXMLStreamReader.consume(JsonXMLStreamReader.java:150)
    
at de.odysseus.staxon.base.AbstractXMLStreamReader.initialize(AbstractXMLStreamReader.java:216)
    ... 
28 more 
Attached Images
File Type: png xdsblisten_1.PNG (29.7 KB, 5 views)
File Type: png xdsblisten_2b.png (70.0 KB, 5 views)
Reply With Quote
  #4  
Old 03-13-2019, 10:28 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,082
narupley is on a distinguished road
Default

One of the nuances of the Interop connectors is that the incoming SOAP XML message gets automatically converted to JSON. This is done because JSON is faster and easier to use in a JavaScript context.

Similarly, the response that you give back to an Interop source connector should also be JSON. There are multiple ways to do that.

The first way is just to build up the JSON directly, exactly like you're currently building that SOAP XML response. For example, you could do that in the Postprocessor Script:

Code:
return JSON.stringify({
  "Envelope" : {
    "@xmlnsprefix" : "SOAP-ENV",
    "@xmlns:wsa" : "http://www.w3.org/2005/08/addressing",
    "@xmlns:s" : "http://www.w3.org/2001/XMLSchema",
    "@xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
    "@xmlns:SOAP-ENV" : "http://www.w3.org/2003/05/soap-envelope",
    "Header" : {
      "@xmlnsprefix" : "SOAP-ENV",
      "Action" : {
        "@xmlnsprefix" : "wsa",
        "@mustUnderstand" : {
          "@xmlnsprefix" : "SOAP-ENV",
          "$" : true
        },
        "$" : "urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-bResponse"
      },
      "MessageID" : {
        "@xmlnsprefix" : "wsa",
        "$" : $('MessageID')
      },
      "RelatesTo" : {
        "@xmlnsprefix" : "wsa",
        "$" : $('RelatesTo')
      },
      "To" : {
        "@xmlnsprefix" : "wsa",
        "$" : "http://www.w3.org/2005/08/addressing/anonymous"
      }
    },
    "Body" : {
      "@xmlnsprefix" : "SOAP-ENV",
      "RegistryResponse" : {
        "@xmlns" : "urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0",
        "@status" : "urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success"
      }
    }
  }
});
Putting it into the response map in the transformer works too.

Or if you prefer building up the SOAP XML, you can still easily convert it to JSON:

Code:
XmlUtil.toJson(customResp)
__________________
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
  #5  
Old 03-13-2019, 11:15 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 245
mcalKno is on a distinguished road
Default

Thanks, Nick! I completely forgot about that aspect of the connector.
Reply With Quote
Reply

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 10:02 AM.


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