none
Byte array lost during WCF serialization process RRS feed

  • Question

  • Configuration:

    • I have the following WCF based service/clients set up:
      Client <=> Gateway <=> Service
    • The binding between the Gateway and the Service is a WS-Security custom binding and the binding between the Gateway and the Client is basicHttpBinding.
    • The data being exchanged is a Person object which has string name, int id, byte[] photo, byte[] certificate, byte[] code, etc.
    • The Service is a third party WCF service.

    Problem:

    The client is requesting a Person object from the Service via the Gateway. In the response, the Gateway is receiving the byte[] type photo and certificate from the Service, but when it's sending out the response to the Client, the byte array is lost during serialization and in the outgoing message I see <d4p1:photo></d4p1:photo>, <d4p1:certificate></d4p1:certificate>, <d4p1:code></d4p1:code>. Regardless of the size of the byte array, the data is missing (the code array is only about 12 bytes long). There is no error or warning logged in the WCF trace log.

    Any insight/suggestion would be highly appreciated.

    Thanks in advance!

    MN


    MN-WA


    • Edited by mn-wa Thursday, September 11, 2014 4:54 PM
    Thursday, September 11, 2014 4:46 PM

Answers

  • Hi,

    Hope the following links help:

    http://social.msdn.microsoft.com/Forums/en-US/c13cdf1e-317d-4202-844f-bc7eabd83ce4/wcf-byte-array-issue?forum=silverlightnet

    http://social.msdn.microsoft.com/Forums/en-US/a1621acb-6c60-41b9-8264-18bb0448dbcf/wcf-streaming-last-byte-is-lost?forum=wcf

    Friday, September 12, 2014 10:07 AM