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
TerminusbotTerminusbot 

WSDL: There is an error in XML document ---> System.FormatException: The string '' is not a valid Boolean value.

I'm sending a Web Service request by calling an external WSDL I imported to Salesforce and I'm getting the following error: 
 
There is an error in XML document (1, 860). ---> System.FormatException: The string '' is not a valid Boolean value.

I have used over methods in the WSDL and they work just fine so the WSDL appears to be ok. I used Postman to initially send over the Soap request to confirm my request will work and it does. When I use the imported WSDL class to send it over I get the above error.

Here is my Apex Class that is calling the WSDL class.
 
public with sharing class UpdateSagittaPolicy {

    public static Boolean AsyncFlag = false;


    @Future(callout=true)
    public static void SendToSagitta(Set<ID> ids) { 
            

        Map<ID, Policy__c> mapPolicies = getPolicy(ids);
        
        System.debug('Map Values: ' + mapPolicies); 
            
        //Initialize Sagitta Services 
        SagittaServices.Results sResult;
        SagittaServices.TransporterSoap port               = new SagittaServices.TransporterSoap();
        SagittaServices.AuthenticationHeader authHeader    = new SagittaServices.AuthenticationHeader(); 
        SagittaServices.Post post                          = new SagittaServices.Post();
            
        // Update Accounts Confirmed with Client Code and Sagitta ID
        List<OpportunityLineItem> updProdLine = new List<OpportunityLineItem>();
        
        

        Integer sizeOfMap = mapPolicies.size();
            for(Policy__c polLine : mapPolicies.values()) {
            
                //Creating instances for complex data types. Postal Code, Producers, Servicers, Categeory Codes
                SagittaServices.policyUpdateMap policy   = new SagittaServices.policyUpdateMap();

                
           
                
                 //Set Producer Code        
                String prodCode = polLine.Producer_1__c; 
                SagittaServices.ProducerCd prod  = new SagittaServices.ProducerCd();
                prod.Producer1Cd = prodCode;

                

                //Sagitta ID
        		SagittaServices.ClientInfo sagID = new SagittaServices.ClientInfo();
                sagID.ClientId = long.valueOf(polLine.SagittaID__c);

                //Client Info
                String sagClientId = '60703';
                SagittaServices.ClientInfo accountInfo = new SagittaServices.ClientInfo();
                accountInfo.ClientId = long.valueOf(sagClientId);

                //Generate Unique ID for GUID over to Sagitta 
                String genGuid = string.ValueOf(Datetime.now().formatGMT('yyyyMMddHHmmssSSS'));
                        

                //Date serviceDate = oppLine.ServiceDate;
                String transDateString = '2017-05-31';
                Date transDate = date.valueOf(transDateString);
                //Transaction Info
                SagittaServices.TransactionInfo transInfo = new SagittaServices.TransactionInfo(); 
                transInfo.TransactionType = 'XLC'; 
                transInfo.TransactionDescription = 'Testing';
                transInfo.TransactionDate  = transDate;
                transInfo.FollowupDays = 30; 

                //Set Login Credentials to AuthHeader
                authHeader.Account    = 'xxxxx';
                authHeader.Username   = 'xxxxx';
                authHeader.Password   = 'xxxxx';
                authHeader.Serverpool = 'xxxxx'; 
                authHeader.Accesscode = null; 
                authHeader.Onlinecode = null;    
                port.AuthenticationHeader = authHeader;  



                //------------------------Policy Insert Map-------------------------------------------
                 
                String cancelReasonCode = 'N';
                String effDate = '2017-03-15';
                String cancDateString = '2017-05-31';
                Date cancDate = date.valueOf(cancDateString);
                String polSagId = '579716';


                policy.Guid         = genGuid;
                policy.ClientInfo   = accountInfo;
                policy.TransactionInformation = transInfo;
                policy.PolicyId     = long.valueOf(polSagId);
                policy.PolicyEffectiveDt = date.valueOf(effDate);
           		policy.CancellationTypeCd = 'P';
               	policy.CancDt = cancDate; 
                policy.CancReasonCd = 'N';
        		policy.CancEvidence = 'C'; 
      			policy.CancNonrenewRenewDt = cancDate;
                
                System.debug('Policy Update' + policy); 
                
                try {
                
                    sResult = port.policyUpdate(policy); 

                    System.debug('Success:'+sResult.Success+'SagittaId:'+sResult.SagittaId+'SagittaCode:'+sResult.SagittaCode+'Errors:'); 

                    //If Succesful, update Account record with Sagitta ID and Client Code 
                    
                    if(sResult.SagittaId != null) {
                        System.debug('Sagitta Id Success');
                            
                    }  else {
                        System.debug('Sagitta Id Error');

                    }
                } catch (Exception ex) {
                    System.debug('ERROR: '+ ex);
                }
    

            }
        


   }

    private static Map<Id, Policy__c> getPolicy(Set<ID> ids){
        Map<Id, Policy__c> oppPolicy;
        oppPolicy = new Map<ID, Policy__c>([SELECT Id, 
											        	IsDeleted, 
											        	Name, 
											        	CreatedDate, 
											        	CreatedById, 
											        	LastModifiedDate, 
											        	LastModifiedById, 
											        	SystemModstamp, 
											        	LastActivityDate, 
											        	LastViewedDate, 
											        	LastReferencedDate, 
											        	Opportunity__c, 
											        	Account__c, 
											        	Effective_Date__c, 
											        	Expiration_Date__c, 
											        	Written_Premium__c, 
											        	Policy_Status__c,
Written_Agency_Comm__c, 
											        	Written_Prod_Comm__c, 
											        	Bill_To_Code__c, 
											        	Billing_Method__c, 
											        	Payee__c, 
											        	Coverage_Name__c, 
											        	Cov__c, 
											        	
											        	Ins__c, 
											        	Client_Code__c, 
											        	State_Risk_is_Located__c, 
											        	Insuror__c, 
											        	Insuror_Name__c, 
											        	Producer_1__c, 
											        	Producer_2__c, 
											        	AE__c, 
											        	Dept__c, 
											        	Carrier_Code__c, 
											        	Coverage_Detail__c, 
											        	Coverages__c, 
											        	EstComPct__c, 
											        	EstCommAmt__c, 
											        	EstPremAmt__c, 
											        	Policy_Term__c, 
											        	Transaction_Type__c, 
											        	SagittaID__c, 
											        	SendQuery__c, 
											        	//Policy_Effective_Month__c, 
											        	//Producer__c, 
											        	RecordTypeName__c, 
											        	//Carrier_Code_Payee__c, 
											        	Accounts__c, 
											        	Product__c, 
											        	//Coverage_Code_Product_Code__c, 
											        	//Policy__c, 
											        	Cancellation_Date__c, 
											        	Cancellation_Method__c, 
											        	Cancellation_Reason__c, 
											        	Reinstatement_Date__c, 
											        	Reinstatement_Reason__c, 
											        	Cancellation_Request_Date__c, 
											        	//Reinstatement_Entry_Date__c, 
											        	Cancellation_Amount__c,
											        	Account_Sagitta_ID__c 
											        	//Finance_Company__c, 
											        	//Last_User__c 
											        	FROM Policy__c
                                                    	Where ID in :ids 
                                                   		 ]);
        System.debug('Product Map Private' + oppPolicy);
        return oppPolicy;
    }
    
  
    
    
}

 I have hardcoded some values for testing. I read on some of the forums that this could be due to issues with DateTime fields. I tried to elimiate the use of DateTime and still getting the error. 

Any suggestions? 

Thanks!