function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CustomDataIntegrationsCustomDataIntegrations 

Attempting to invoke an outside .NET WCF Service

I have an external .NET WCF Service that I am trying to invoke from outside the Salesforce sandbox.  One of the arguments in the .NET WCF Service function call is a byte array.  What is the appropriate conversion in APEX so that I can pass data to this function?

 

WSDL element:

<xs:elementminOccurs="0"name="FileContents"nillable="true"type="xs:base64Binary" />

 

 

Call to this:

String filecontents = BuildFile();
inputfile.FileName = 'SalesForceAddressFile.txt';
inputfile.FileContents = EncodingUtil.base64Encode(Blob.valueOf(filecontents));

 

When I look at the DataContract that was pulled in, the property is a String, but defined to the service as base64Binary.

 

 

But when I invoke the webservice, there is an error thrown and I have narrowed it down to this property.  What am I doing wrong?