|
View Poll Results: Do you use .Net to send data to Mirth | |||
Yes - HL7 Data |
![]() ![]() ![]() ![]() |
0 | 0% |
Yes - XML |
![]() ![]() ![]() ![]() |
0 | 0% |
Yes - Other |
![]() ![]() ![]() ![]() |
0 | 0% |
No |
![]() ![]() ![]() ![]() |
2 | 100.00% |
Voters: 2. You may not vote on this poll |
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I am using Mirth 3.4.2.8129 to try and collect data from a .Net application through a web service (really any way that I can...I have tried HTTP as well and all methodes are a big Brick Wall).
Attached are the Web Service Listener and a Sender that I used to test with (btw...it works). But when I use the .Net app (set up just like this video from 2009) to send to the Listener the Listener fires off, but I see no data in the Message. I have used a sniffer and see that the data is in the message being sent, just as it is when it is sent from within Mirth using the WS Sender. Any idea what I am doing wrong? Thanks, Doug |
#2
|
||||
|
||||
![]()
Could be differences in the SOAP binding version being used.
__________________
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. ![]()
|
#3
|
|||
|
|||
![]()
Found my issue. In the following c# code to send the request the ContentType must be correct:
HttpWebRequest request = HttpWebRequest.Create("http://localhost:8081/services/Mirth") as HttpWebRequest; request.Method = "POST"; string postData = theXml; byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(postData); // \/ \/ This must be correct \/ \/ \/ request.ContentType = "text/xml"; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); WebResponse response = request.GetResponse(); Console.WriteLine(((HttpWebResponse)response).Stat usDescription); dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); reader.Close(); dataStream.Close(); response.Close(); Then the postData has to be the entire soap message. I wound up sending my data pipe delimited, something like this(where TheReport is the encoded PDF): <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.connectors.connect.mirth.com/"> <soapenv:Header> </soapenv:Header> <soapenv:Body> <ws:acceptMessage> <!--Optional:--> <arg0 xmlns=""> M|654789|Fred Smith|ED|TheReport </arg0> </ws:acceptMessage> </soapenv:Body> </soapenv:Envelope> |
![]() |
Tags |
.net, dot net, mirth, web service, web service listener |
Thread Tools | |
Display Modes | |
|
|