Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9245449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:16:12+00:00 2026-06-18T09:16:12+00:00

This question is a bit more specific than what the title indicates. I’ve tried

  • 0

This question is a bit more specific than what the title indicates.
I’ve tried several methods, hoping to get the request XML to deserialize into an object, with nothing but problems. Read on, and please just make a suggestion for some ideas for me to look into.

The Problems:

I am stuck receiving a POST in HL7 format. This is approximately a 55k post with about 200 bytes of useful info in it. I only need to extract those few bytes. Normally, this will only be about 30 bytes, depending how many tracking numbers are sent to me. NO, I do not have any say in changing this.

This HL7 data is in standard XML format, with the exception that a lot of Attributes are used to carry data, instead of Elements. Again, I seem to be stuck with the sender doing it this way. ( My preference, and experience with web services, is the standard MS Soap/WSDL setup. )

I have used XSD.exe to create a class to contain the deserialized data ( from some sample XML that will be sent to me. ), however, XSD seems to convert all attributes to elements. When I view the resulting WCF service page, I don’t see xml that looks like what I am receiving. This difference seems to be preventing the deserialization of the HL7 request? See the following abbreviated samples:

Sample of an abbreviated inbound request(because dealing with the 55k sample was killing my brain), just the first few lines:

<?xml version="1.0" encoding="utf-8"?>
<QUQI_IN300102XXX xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0">
  <realmCode code="XXX" />
  <id extension="XX011111" />
  <creationTime value="20121220133424-0500" />
  <responseModeCode code="IMMEDIATE" />
  <versionCode code="V3-2010-12" />
  <interactionId extension="QUQI_IN300102XXX" />
  <processingCode code="P" />
  <processingModeCode code="T" />
  <acceptAckCode code="NE" />
  <receiver typeCode="RCV">
    <realmCode code="XXX" />
    <device>
      <realmCode code="XXX" />
      <id extension="XXXIB" assigningAuthorityName="Service" />
    </device>
  </receiver>
  <sender typeCode="SND">
    <realmCode code="XXX" />
    <device>
      <realmCode code="XXX" />
      <id assigningAuthorityName="CCC" />
    </device>
  </sender>
  <controlActEvent>
    <realmCode code="XXX" />
    <id extension="Tracking" assigningAuthorityName="TRANSTYPE" />
    <code code="Order" />
    <statusCode />
    <queryByParameter>
      <realmCode code="XXX" />
      <queryId extension="NJ011111A-20121220133343" />
      <parameterList>
        <realmCode code="XXX" />
        <accessionNum>
          <value extension="NJ011111A" />
        </accessionNum>
        <batchNumber>
          <value extension="120927001" assigningAuthorityName="ZZ1" />
          <value extension="120927002" assigningAuthorityName="ZZ1" />
        </batchNumber>

The “batchNumber” is the primary data I need to get from the inbound request.

If I view the “WCF project” service help page ( created by using the WCF REST project type nuget package, if I remember correctly ), I get:

<QUQI_IN300102QD>
  <realmCode>
<realmCode>
  <code>String content</code>
</realmCode>
<realmCode>
  <code>String content</code>
</realmCode>
  </realmCode>
  <id>
<id>
  <extension>String content</extension>
  <assigningAuthorityName>String content</assigningAuthorityName>
</id>
<id>
  <extension>String content</extension>
  <assigningAuthorityName>String content</assigningAuthorityName>
</id>
  </id>
  <creationTime>
    <QUQI_IN300102QDCreationTime>
  <value>String content</value>
   </QUQI_IN300102QDCreationTime>
  <QUQI_IN300102QDCreationTime>
    <value>String content</value>
   </QUQI_IN300102QDCreationTime>
  </creationTime>

Now, the XML that I fed into XSD.exe does not look like what the service page hands out, and for whatever reason, when I pass in the post request, it will not deserialize.

I hope that’s enough information to describe my problem.

What is my best choice for a solution?

Create an MVC project and accept an XMLDoc as the post datatype, and do XML manipulations to get what I need? Or some other option?

FYI, the return data has to be inserted into the XML at some point, but I haven’t gotten that far yet.

FYI, my experience with creating web services has been limited to VS. You know, File, New Project, Web Service. Then adding a proxy to the WSDL page in the consuming project and just using the thing. With, of course, a third project just containing the class objects for reference by the other two projects, and some data-access project.

Using Fiddler to compose my requests, and I have WCF tracing turned on.

What I get from the trace is:

Unable to deserialize XML body with root name ‘Binary’ and root namespace ” (for operation ‘methodTrackQLSBatch’ and contract (‘ShipmentTracking’, ‘http://tempuri.org/‘)) using XmlSerializer. Ensure that the type corresponding to the XML is added to the known types collection of the service.

It DOES know the type. If I change everything around to use a very simple piece of XML, it deserializes perfectly.

Thank you in advance for any thoughts.

I guess to put it succinctly, how can I accept this large HL7 request, extract data from it, insert results into it, and then return it? ( And I can probably figure out the “return it” portion, heh. Although you never know. )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:16:13+00:00Added an answer on June 18, 2026 at 9:16 am

    It sounds like you won’t get much bang for your buck deserializing the XML in this case. If you are only interested in a small amount of the data, and in the end you just want to modify the XML and return it, just read and manipulate the XML with Linq to XML. (Eg XDocument, XElement, etc)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed This question , but my question is a bit more specific. Is
A bit more specific than Stack Overflow question What is an existential type? ,
This is more of a general question rather than a specific problem. I'm coding
This is a bit of an odd question and more of a though experiment
This question is a bit of a two-parter. First, the title question. Here's what
This is a bit of a random question that is more out of curiosity
This is more a question of how would you go about doing this than
This question is a bit of a two parter for .Net data services. This
This question is a bit open ended as I'm not sure it's possible or
Sorry if this question is a bit open ended, but I'm pretty new to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.