none
WCF response is missing data RRS feed

  • Question

  • Hello,

    I have a WSDL provided by a vendor that I used to generate proxies in .NET.  Certain fields were coming back as NULL when they should have had values.

    I took the same exact WSDL and used it in SoapUI.  SoapUI showed data in the fields that .NET showed as NULL.

    Here is the Response from SoapUI:

    <env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Body>
          <n1:RetrieveReferralResponse env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:n1="http://www.myvendor.com">
             <return xsi:type="n1:Referral">
                <id xsi:type="xsd:int">1234</id>
                <business xsi:type="xsd:string">My Business</business>
                <fdcActivationDate xsi:type="xsd:string">2017-02-02 00:00:00 -0500</fdcActivationDate>
                <fdcCreatedAt xsi:type="xsd:dateTime">2017-01-30T11:29:19Z</fdcCreatedAt>
                <fdcCreditDate xsi:type="xsd:string">2017-01-31 00:00:00 -0500</fdcCreditDate>
                <fdcCreditStatus xsi:type="xsd:string">Approved</fdcCreditStatus>
                <fdcDbaName xsi:type="xsd:string">MY BUSINESS</fdcDbaName>
                <fdcMerchantId xsi:type="xsd:string">12345678</fdcMerchantId>
                <fdcReferralStatus xsi:type="xsd:string">Closed Won</fdcReferralStatus>
                <fdcUpdatedAt xsi:type="xsd:dateTime">2017-02-03T21:08:00Z</fdcUpdatedAt>
             </return>
          </n1:RetrieveReferralResponse>
       </env:Body>
    </env:Envelope>

    Here is the Response from .NET:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body>
          <RetrieveReferralResponse xmlns="http://MerchantReferralService.Operations">
             <RetrieveReferralResult xmlns:a="http://schemas.datacontract.org/2004/07/MerchantReferralService.PROD" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <a:PropertyChanged i:nil="true" xmlns:b="http://schemas.datacontract.org/2004/07/System.ComponentModel"/>
                <a:idField>4513939</a:idField>
    <a:businessField>My Business</a:businessField>
                <a:fdcActivationDateField>2017-02-02 00:00:00 -0500</a:fdcActivationDateField>
                <a:fdcCreatedAtField>2017-01-30T11:29:19Z</a:fdcCreatedAtField>
                <a:fdcCreditDateField i:nil="true"/>
                <a:fdcCreditStatusField i:nil="true"/>
                <a:fdcDbaNameField i:nil="true"/>
                <a:fdcMerchantIdField i:nil="true"/>
                <a:fdcReferralStatusField i:nil="true"/>
                <a:fdcUpdatedAtField i:nil="true"/>
             </RetrieveReferralResult>
          </RetrieveReferralResponse>
       </s:Body>
    </s:Envelope>

    The .NET response is showing the Credit Date, Credit Status, DBA Name, Merchant ID, Referral Status and Updated At as NULL. 

    I had the vendor capture the Requests and Responses from SoapUI and .NET and they show the Responses being identical.  All the fields have values.  So, I'm wondering why .NET is excluding certain fields.

    Any assistance would be appreciated!

    Thank you very much!!

    Wednesday, February 27, 2019 4:58 PM

All replies

  • Hi Hiline1961,

    According to your description, I also don’t know where the issue went wrong. Is it possible that you pass the wrong parameters(spelling typo, capitalization problem)?

    By the way, I would like to check how do you call the web service through DoNet, I will be appreciated that you could share the code with me. Or the another situation, even if you're using the same code as the vendor, there's still a problem on your side.

    Look forward to your reply.

    Best Regards

    Abraham


    Thursday, February 28, 2019 3:12 AM
    Moderator
  • Hello Abraham!

    Thanks for responding.  I have verified that I am passing the correct parameters.  And, the vendor states that their logs show their response to include all the data elements.

    However, when the .NET payload shows various elements as NULL when the vendor logs show the fields as containing data.

    For .NET and SoapUI I used the same WSDL file to generate the proxies.  In .NET I named the Service Reference as PROD.

    The .NET operation I'm calling from SoapUI is as follows:

    public PROD.Referral RetrieveReferral(int referralID)
    {
         PROD.RemotePortClient client = new PROD.RemotePortClient();
         PROD.LoginResult result = client.Login(DOMIAN, USER, PASSWORD);
         if (result.success==true)
         {
         return client.RetrieveReferral(result.sessionId, referralID);
         }
    throw new FaultException("Login Unsuccessful");
    }

    I've asked the Vendor for a new WSDL.  I'm going to regenerate the proxy classes.  If that doesn't clear the issue I saw a post by Carlos Figueira on capturing the data at the Message Encoder and I'll do that to inspect the payload.

    Thanks!!!!



    • Edited by Hiline1961 Thursday, February 28, 2019 5:22 PM
    Thursday, February 28, 2019 4:34 PM
  • Hi Hiline1961,
    Have you solved the problem?  In order to prevent this issue will be a meaningless discussion, I would like you could share your solution here and help others who encountered similar questions.
    Best Regards
    Abraham
    Monday, May 27, 2019 2:01 AM
    Moderator