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 6087183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:50:30+00:00 2026-05-23T11:50:30+00:00

My Problem: I have a WCF Web Service that is being called by a

  • 0

My Problem:

I have a WCF Web Service that is being called by a simple .NET test client and is returning null values for several of the properties of the custom class that is being being returned.

  • Checking the values of the return object at a breakpoint just before it is returned shows me that all of the values are correctly populated, but the value of that object as soon as it is received shows several of its properties as being ‘null.’
  • I have read several other stackoverflow posts of people reporting the same issue, and several have been resolved by alphabetizing / assigning an order to the [DataContracts] in the interface, but that has not affected my results.
  • The values seem to be reaching the client program though, because the response from running a SoapUI test shows the correct values in the XML.

Code:

[ServiceContract]
public interface IService
{
    [OperationContract]
    TotalTaxResult GetTotalTax(OrderHeader orderHeader);
}

[DataContract]
public class TotalTaxResult
{
    [DataMember]
    public string Message { get; set; }

    [DataMember]
    public ProductLineItem[] ProductLineItems { get; set; }

    [DataMember]
    public string ResultCode { get; set; }

    [DataMember]
    public DataSet ResultDataSet { get; set; }

    [DataMember]
    public string strTaxLinesCount { get; set; }

    [DataMember]
    public DataSet taxDataSet { get; set; }

    [DataMember(IsRequired = true)]
    public decimal TotalTax { get; set; }

    [DataMember]
    public Avalara.AvaTax.Adapter.TaxService.TaxLines TotalTaxLines { get; set; }

}

Soap Request

     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:sal="http://schemas.datacontract.org/2004/07/SalesService">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:GetTotalTax>
         <!--Optional:-->
         <tem:orderHeader>
            <!--Optional:-->
            <sal:BFCustomerNumber>123456</sal:BFCustomerNumber>
            <!--Optional:-->
            <sal:BFStoreNumber>654321</sal:BFStoreNumber>
            <!--Optional:-->
            <sal:CustomerName>Nick T</sal:CustomerName>
            <!--Optional:-->
            <sal:Message></sal:Message>
            <sal:OrderLineItems>
               <!--Zero or more repetitions:-->
               <sal:OrderLineItem>
                  <sal:ItemNumber>164080</sal:ItemNumber>
                  <sal:LineNumber>1</sal:LineNumber>
                  <sal:Price>100</sal:Price>
                  <sal:Quantity>1</sal:Quantity>
                  <sal:TaxCode>S</sal:TaxCode>
                  <sal:UoM>CA</sal:UoM>
               </sal:OrderLineItem>
            </sal:OrderLineItems>
            <!--Optional:-->
            <sal:PONumber>333000</sal:PONumber>
            <!--Optional:-->
            <sal:ResultCode></sal:ResultCode>
            <!--Optional:-->
            <sal:SourceSystem>WEB</sal:SourceSystem>
            <sal:TestFlag>true</sal:TestFlag>
            <!--Optional:-->
            <sal:TotalTax></sal:TotalTax>
            <!--Optional:-->
            <sal:WarehouseNum>3010</sal:WarehouseNum>
            <!--Optional:-->
            <sal:validDest>
               <!--Optional:-->
               <sal:AddressCode></sal:AddressCode>
               <!--Optional:-->
               <sal:AddressType>S</sal:AddressType>
               <!--Optional:-->
               <sal:CarrierRoute>C022</sal:CarrierRoute>
               <!--Optional:-->
               <sal:City>SAINT LOUIS</sal:City>
               <!--Optional:-->
               <sal:Country>US</sal:Country>
               <!--Optional:-->
               <sal:County>SAINT LOUIS</sal:County>
               <!--Optional:-->
               <sal:FipsCode>2918900000</sal:FipsCode>
               <!--Optional:-->
               <sal:Latitude>30.0000</sal:Latitude>
               <!--Optional:-->
               <sal:Line1>1234 DELMAR DR</sal:Line1>
               <!--Optional:-->
               <sal:Line2></sal:Line2>
               <!--Optional:-->
               <sal:Line3></sal:Line3>
               <!--Optional:-->
               <sal:Line4>SAINT LOUIS MO 63130-6642</sal:Line4>
               <!--Optional:-->
               <sal:Longitude>-95.8765</sal:Longitude>
               <!--Optional:-->
               <sal:PostNet>631306632524</sal:PostNet>
               <!--Optional:-->
               <sal:PostalCode>63130-6642</sal:PostalCode>
               <!--Optional:-->
               <sal:Region>MO</sal:Region>
            </sal:validDest>
            <!--Optional:-->
            <sal:validOrigin>
               <!--Optional:-->
               <sal:AddressCode></sal:AddressCode>
               <!--Optional:-->
               <sal:AddressType>H</sal:AddressType>
               <!--Optional:-->
               <sal:CarrierRoute>R030</sal:CarrierRoute>
               <!--Optional:-->
               <sal:City>SAINT CHARLES</sal:City>
               <!--Optional:-->
               <sal:Country>US</sal:Country>
               <!--Optional:-->
               <sal:County>SAINT CHARLES</sal:County>
               <!--Optional:-->
               <sal:FipsCode>296543210</sal:FipsCode>
               <!--Optional:-->
               <sal:Latitude>35.8034</sal:Latitude>
               <!--Optional:-->
               <sal:Line1>500 ORCHARD LAKES BLVD</sal:Line1>
               <!--Optional:-->
               <sal:Line2></sal:Line2>
               <!--Optional:-->
               <sal:Line3></sal:Line3>
               <!--Optional:-->
               <sal:Line4>SAINT CHARLES MO 63331-4341</sal:Line4>
               <!--Optional:-->
               <sal:Longitude>-95.5021</sal:Longitude>
               <!--Optional:-->
               <sal:PostNet>63389541997</sal:PostNet>
               <!--Optional:-->
               <sal:PostalCode>63331-4341</sal:PostalCode>
               <!--Optional:-->
               <sal:Region>MO</sal:Region>
            </sal:validOrigin>
         </tem:orderHeader>
      </tem:GetTotalTax>
   </soapenv:Body>
</soapenv:Envelope>

Soap Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <GetTotalTaxResponse xmlns="http://tempuri.org/">
         <GetTotalTaxResult xmlns:a="http://schemas.datacontract.org/2004/07/SalesService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <a:Message>Total Tax Calc</a:Message>
            <a:ProductLineItems i:nil="true"/>
            <a:ResultCode>7.46</a:ResultCode>
            <a:ResultDataSet i:nil="true"/>
            <a:TotalTax>7.46</a:TotalTax>
            <a:TotalTaxLines xmlns:b="http://schemas.datacontract.org/2004/07/Avalara.AvaTax.Adapter.TaxService"/>
            <a:strTaxLinesCount>1</a:strTaxLinesCount>
            <a:taxDataSet>
               <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
                     <xs:complexType>
                        <xs:choice minOccurs="0" maxOccurs="unbounded">
                           <xs:element name="TaxDataTable">
                              <xs:complexType>
                                 <xs:sequence>
                                    <xs:element name="TaxIndex" type="xs:int" minOccurs="0"/>
                                    <xs:element name="TaxLineNo" type="xs:string" minOccurs="0"/>
                                    <xs:element name="TaxCode" type="xs:string" minOccurs="0"/>
                                    <xs:element name="TaxAmount" type="xs:decimal" minOccurs="0"/>
                                 </xs:sequence>
                              </xs:complexType>
                           </xs:element>
                        </xs:choice>
                     </xs:complexType>
                  </xs:element>
               </xs:schema>
               <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                  <NewDataSet xmlns="">
                     <TaxDataTable diffgr:id="TaxDataTable1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
                        <TaxIndex>0</TaxIndex>
                        <TaxLineNo>1</TaxLineNo>
                        <TaxCode>P0000000</TaxCode>
                        <TaxAmount>7.46</TaxAmount>
                     </TaxDataTable>
                  </NewDataSet>
               </diffgr:diffgram>
            </a:taxDataSet>
         </GetTotalTaxResult>
      </GetTotalTaxResponse>
   </s:Body>
</s:Envelope>

.NET Client Results:

‘null’ values for:

  • ProductLineItems
  • strTaxLinesCount
  • ResultDataSet returns as an empty DataSet
  • taxDataSet
  • TotalTax returns as ‘0’
  • TotalTaxLines

The only properties with their proper values are:

  • Message
  • ResultCode

No exceptions are thrown during the entire process.

Ordering the interface through [DataMember(Order=1)] did not affect the results. The same properties returned as null.

If anybody has any suggestions, they’d be greatly appreciated. I’m fairly new to .NET and have been banging my head against this problem for a few days now. If any further information / code snippets are needed, please let me know. Thanks in advance.

  • 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-05-23T11:50:31+00:00Added an answer on May 23, 2026 at 11:50 am

    How did you generate your client? You might just need to regenerate or update your client. For example, if you generated the client, then added one of those properties to the server, but did not regenerate the client, then the value would get passed back tot he client, but the client would ignore it because it doesn’t know what it is.

    That is my best guess, anyway…


    Actually, reading your question again, you stated that:

    The values seem to be reaching the
    client program though, because the
    response from running a SoapUI test
    shows the correct values in the XML.

    However comparing the list of items you say are null and the soap response:

    • ProductLineItems

    Is null in the soap response:

    <a:ProductLineItems i:nil="true"/>
    
    • TotalTaxLines

    Is null in the soap response:

    <a:TotalTaxLines xmlns:b="http://schemas.datacontract.org/2004/07/Avalara.AvaTax.Adapter.TaxService"/>
    

    So I have to assume that those are actually correctly returning null.


    In addition, for the properties that contain these non-standard data types:

    • ProductLineItem
    • Avalara.AvaTax.Adapter.TaxService.TaxLines

    Those two data types need to me marked as [DataContract] also, or I think ISerializable will work too.

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

Sidebar

Related Questions

I have a WCF web service called Palladium that is created as a project
So I came across an interesting problem today. We have a WCF web service
I have a WCF service and web client. Web service implements one method SubmitOrders.
I have a silverlight 2 beta 2 application that accesses a WCF web service.
I have a plugin that exposes a wcf service. if I test this service
I created a simple WCF web service that has one method: SubmitTicket(flightticket ft, string
I have an upload/download web service that I created with WCF. Im using c
I have deployed a Java metro web service that is being consumed by a
I have created a WCF web service that connects to an XMPP service with
Problem: I have a WCF service setup to be an endpoint for a call

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.