• Giorgio Porro
  • NEWBIE
  • 50 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
Hello

I've been using the Force IDE plugin for many years. I used to be able to Right Click on a Test Class, and hit Run Tests, and see what coverage that calss would give me. I would also be able to see the list of lines of code NOT covered by the test, in each Class or Trigger

With the Winter 16 release I am a little lost. I understand how to run a test or all the tests, but once the test runs, I my issue is now: how do I find the lines of code that are not covered by my test?

For example I see that the iRT_Utility class is covered at 82% (110/134). Where do I find the 24 lines not covered?

Thanks in advance
Giorgio
 
Hello,

I'm trying to make a call to a WebService that requires the Soap Security Header to be provided in the message. They also require Password Digest.

I am able to POST a message to the service, and getting the response I'm looking for, using a tool such as SOAP UI. In the log I see the Soap Header looks like this

<soapenv:Header><wsse:Security soapenv:mustUnderstand="1" 
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-0A895E4ED2XY1B64BB142239383782811>
    <wsse:Username>irhythmtest</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">kxPMdaV96UNV1OXw0B83IpnwgNc=</wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">LTYzMDgmJTU1MTE5ODgyMjQ2HOZ==</wsse:Nonce>
    <wsu:Created>2015-01-27T09:41:14Z</wsu:Created>
</wsse:UsernameToken></wsse:Security></soapenv:Header>

What I'm trying to do is to create this header in an Apex Class.
I highligheted in BOLD (above) the "variable" fields.

- For Password Digest, I'm generating the string using the process below

            Blob targetBlob = Blob.valueOf('mypass');
            Blob hash = Crypto.generateDigest('SHA1', targetBlob);
            String b64 = EncodingUtil.base64Encode(hash);  

- For Nonce, I'm generating the string using the process below

            Long randomLong = Crypto.getRandomLong();
            String Nounce = EncodingUtil.base64Encode(Blob.valueOf(String.valueOf(randomLong)));

- For Created, I'm generating the string using the process below

            String Create = Datetime.now().formatGmt('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'');

I am not sure what goes in the wsu:Id="UsernameToken part of the header. How are tools such as SOAP UI generating a different and accepted Token in each call?

Any help or ideas on this would be highly appreciated

Thanks!
Giorgio
Hello

I developed an API callout to a SOAP webservice.
How can I see the actual XML message being generate by the invoke methid?
I call the invoke method below:


WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'iRT_XIFIN_Client',
              'RequestMessage',
              'iRT_XIFIN_Client',
              'ResponseMessage',
              'iRT_XIFIN_Client.ResponseMessage_element'}
            );
            
and my webservice expects something like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://www.xifin.com/schema/client" xmlns:msg="http://www.xifin.com/schema/msgHeader">
   <soapenv:Header/>
   <soapenv:Body>
      <cli:RequestMessage>
         <msg:MessageHeader>
            
            <msg:SequenceNumber>1</msg:SequenceNumber><msg:UserId>Tester</msg:UserId>          
            <msg:SourceApplication>?</msg:SourceApplication><msg:OrgAlias>irhythmtest</msg:OrgAlias>          
         </msg:MessageHeader>
         <cli:Payload>                                                                
         <cli:GetClient><cli:ClientId>883</cli:ClientId></cli:GetClient></cli:Payload>
      </cli:RequestMessage>
   </soapenv:Body>
</soapenv:Envelope>

Thanks
Giorgio

Hello,

I need to make calls to an esternal WebService. I did get their .wsdl and was able to create my class using wsdl2apex.
The services allows me to do a couple of things: Lookup a Client by ID or Create a new Client.

Here's some highlights of what the APEX class looks like. I have some data classes

    public class MessageHeader_element {
        public String OrganizationName = 'TEST';
        public Integer SequenceNumber;
        public String UserId;
        public String SourceApplication;
        public String OrgAlias;
        private String[] OrganizationName_type_info = new String[]{'OrganizationName','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] SequenceNumber_type_info = new String[]{'SequenceNumber','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] UserId_type_info = new String[]{'UserId','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] SourceApplication_type_info = new String[]{'SourceApplication','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] OrgAlias_type_info = new String[]{'OrgAlias','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'OrganizationName','SequenceNumber','UserId','SourceApplication','OrgAlias'};
    }
    public class StatusType {
        public String StatusCode;
        public String StatusMessage;
        private String[] StatusCode_type_info = new String[]{'StatusCode','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] StatusMessage_type_info = new String[]{'StatusMessage','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'StatusCode','StatusMessage'};
    }    
    public class Payload_element {
        public iRT_XIFIN_Client.StatusType Status;
        public iRT_XIFIN_Client.GetClientResponse GetClientResponse;
        private String[] Status_type_info = new String[]{'Status','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] GetClientResponse_type_info = new String[]{'GetClientResponse','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'Status','GetClientResponse'};
    }

    public class GetClient_element {
        public String ClientId;
        private String[] ClientId_type_info = new String[]{'ClientId','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'ClientId'};
    }

    public class AddClient_element {
        public String AccountName;
        public iRT_XIFIN_Client.AdditionalStatementCopyType[] AdditionalStatementCopy;
        public Boolean BillReferralsToClient;
        public iRT_XIFIN_Client.BillingAddressType BillingAddress;
        public String ClientAccountType;
        public String ClientID;
        public String ClientStatementDeliveryMethod;
        public String ClientSubmissionServiceId;
        public iRT_XIFIN_Client.CorrespondenceAddressType CorrespondenceAddress;
        public Boolean DailyCharges;
        public String DailyChargesFrequency;
        public String DailyChargesNotificationMethod;
        public iRT_XIFIN_Client.Questions_element Questions;
        public String NPI;
        public iRT_XIFIN_Client.POs_element POs;
        public String PrimaryFacility;
        public iRT_XIFIN_Client.RefundAddress_element RefundAddress;
        public Date StartDate;
        public String StatementFrequency;
        public iRT_XIFIN_Client.BillingAddressType StreetAddress;
        public String TaxId;
        public iRT_XIFIN_Client.XRefs_element XRefs;
        public String CopyClientId;
        public Boolean copyBillingAddressToShippingAddress;
        public iRT_XIFIN_Client.ShippingAddressType ShippingAddress;
        private String[] AccountName_type_info = new String[]{'AccountName','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] AdditionalStatementCopy_type_info = new String[]{'AdditionalStatementCopy','http://www.xifin.com/schema/client',null,'0','-1','false'};
        private String[] BillReferralsToClient_type_info = new String[]{'BillReferralsToClient','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] BillingAddress_type_info = new String[]{'BillingAddress','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] ClientAccountType_type_info = new String[]{'ClientAccountType','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] ClientID_type_info = new String[]{'ClientID','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] ClientStatementDeliveryMethod_type_info = new String[]{'ClientStatementDeliveryMethod','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] ClientSubmissionServiceId_type_info = new String[]{'ClientSubmissionServiceId','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] CorrespondenceAddress_type_info = new String[]{'CorrespondenceAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] DailyCharges_type_info = new String[]{'DailyCharges','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] DailyChargesFrequency_type_info = new String[]{'DailyChargesFrequency','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] DailyChargesNotificationMethod_type_info = new String[]{'DailyChargesNotificationMethod','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] Questions_type_info = new String[]{'Questions','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] NPI_type_info = new String[]{'NPI','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] POs_type_info = new String[]{'POs','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] PrimaryFacility_type_info = new String[]{'PrimaryFacility','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] RefundAddress_type_info = new String[]{'RefundAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] StartDate_type_info = new String[]{'StartDate','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] StatementFrequency_type_info = new String[]{'StatementFrequency','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] StreetAddress_type_info = new String[]{'StreetAddress','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] TaxId_type_info = new String[]{'TaxId','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] XRefs_type_info = new String[]{'XRefs','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] CopyClientId_type_info = new String[]{'CopyClientId','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] copyBillingAddressToShippingAddress_type_info = new String[]{'copyBillingAddressToShippingAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] ShippingAddress_type_info = new String[]{'ShippingAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'AccountName','AdditionalStatementCopy','BillReferralsToClient','BillingAddress','ClientAccountType','ClientID','ClientStatementDeliveryMethod','ClientSubmissionServiceId','CorrespondenceAddress','DailyCharges','DailyChargesFrequency','DailyChargesNotificationMethod','Questions','NPI','POs','PrimaryFacility','RefundAddress','StartDate','StatementFrequency','StreetAddress','TaxId','XRefs','CopyClientId','copyBillingAddressToShippingAddress','ShippingAddress'};
    }

and a method to invoke the service

        public iRT_XIFIN_Client.ResponseMessage_element XIFIN_Request (iRT_XIFIN_Client.MessageHeader_element MessageHeader, iRT_XIFIN_Client.Payload_element Payload) {
            // Create a new SOAP Request (will be sent to XIFIN)
            iRT_XIFIN_Client.RequestMessage_element request_x = new iRT_XIFIN_Client.RequestMessage_element();
            // Create a new SOAP Request Message Header from the parameter             
            request_x.MessageHeader = MessageHeader;
            // Create a new SOAP Request Payload from the parameter             
            request_x.Payload = Payload;
            // Create a new SOAP Response (will receive back from XIFIN)
            iRT_XIFIN_Client.ResponseMessage_element response_x;
            Map<String, iRT_XIFIN_Client.ResponseMessage_element> response_map_x = new Map<String, iRT_XIFIN_Client.ResponseMessage_element>();
            response_map_x.put('response_x', response_x);
            // Invoke the SOAP Web Service
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://www.xifin.com/schema/client',
              'RequestMessage',
              'http://www.xifin.com/schema/client',
              'ResponseMessage',
              'iRT_XIFIN_Client.ResponseMessage_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }

The method takes two parameters: MessageHeader_element and Payload_element

I want to be able to call the Get Client service. This is what the Webservice is expecting to receive in my call

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://www.xifin.com/schema/client" xmlns:msg="http://www.xifin.com/schema/msgHeader">
   <soapenv:Header/>
   <soapenv:Body>
      <cli:RequestMessage>
         <msg:MessageHeader>
            <!--Optional:-->
            <msg:OrganizationName>Demo</msg:OrganizationName>
            <!--Optional:-->
            <msg:SequenceNumber>123</msg:SequenceNumber>
            <msg:UserId>test_user</msg:UserId>
            <!--Optional:-->
            <msg:OrgAlias>demo</msg:OrgAlias>
         </msg:MessageHeader>
         <cli:Payload>
            <cli:GetClient>
               <cli:ClientId>DEOM857612</cli:ClientId>
            </cli:GetClient>
         </cli:Payload>
      </cli:RequestMessage>
   </soapenv:Body>
</soapenv:Envelope>

My issue is: how do I add the service to my payload class? It's unclear to me how I construct the code to decide whish service to invoke (Get Client vs. Add Client) 

IF you have any idea, I'd really appreciate the help
Thanks

Giorgio



 

Hello

If there a way to create a custom Action on my Case Feed that simply runs some Apex?

My user case: we have hundreds of cases open, and our agents reach out daily trying to contact the customer. Often the customer won't pickup, and all we want to do is leave a voicemail and track interaction that in SFDC.

They can use the "Log a call" standard action, and type LVM, but I was wondering if I can have a custom action that does just that, bypassing the need to even type LVM (that woud save the agent a few clicks)

Any suggestion on whether this could be done and pointers on how? 
 

Thanks
Giorgio

Hello

I created a very simple schedulable interface that executes a number of Batch jobs. 

Is is possible to run additional code only once all batch jobs are complete?
See below.

Thanks a lot in advance
Giorgio

global class iRT_SCHEDULE_Contest implements Schedulable{
   global void execute(SchedulableContext SC) {
 
  List<Contest__c> cList = new List<Contest__c>();  

  cList = [select id from Contest__c]; 
  delete cList;  
 
     // We set the size to 20, 50 etc so that the Batch Jobs reset the governor limits every x iterations
  iRT_BATCH_Contest actuals = new iRT_BATCH_Contest(); 
       database.executebatch(actuals,1); 

>>> CAN I ADD SOME CODE HERE, THAT RUNS ONLY AFTER ALL BATCH JOBS ARE COMPLETE?

              
   }

Hello

I've been using the Force IDE plugin for many years. I used to be able to Right Click on a Test Class, and hit Run Tests, and see what coverage that calss would give me. I would also be able to see the list of lines of code NOT covered by the test, in each Class or Trigger

With the Winter 16 release I am a little lost. I understand how to run a test or all the tests, but once the test runs, I my issue is now: how do I find the lines of code that are not covered by my test?

For example I see that the iRT_Utility class is covered at 82% (110/134). Where do I find the 24 lines not covered?

Thanks in advance
Giorgio
 

Hello,

I need to make calls to an esternal WebService. I did get their .wsdl and was able to create my class using wsdl2apex.
The services allows me to do a couple of things: Lookup a Client by ID or Create a new Client.

Here's some highlights of what the APEX class looks like. I have some data classes

    public class MessageHeader_element {
        public String OrganizationName = 'TEST';
        public Integer SequenceNumber;
        public String UserId;
        public String SourceApplication;
        public String OrgAlias;
        private String[] OrganizationName_type_info = new String[]{'OrganizationName','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] SequenceNumber_type_info = new String[]{'SequenceNumber','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] UserId_type_info = new String[]{'UserId','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] SourceApplication_type_info = new String[]{'SourceApplication','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] OrgAlias_type_info = new String[]{'OrgAlias','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'OrganizationName','SequenceNumber','UserId','SourceApplication','OrgAlias'};
    }
    public class StatusType {
        public String StatusCode;
        public String StatusMessage;
        private String[] StatusCode_type_info = new String[]{'StatusCode','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] StatusMessage_type_info = new String[]{'StatusMessage','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'StatusCode','StatusMessage'};
    }    
    public class Payload_element {
        public iRT_XIFIN_Client.StatusType Status;
        public iRT_XIFIN_Client.GetClientResponse GetClientResponse;
        private String[] Status_type_info = new String[]{'Status','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] GetClientResponse_type_info = new String[]{'GetClientResponse','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'Status','GetClientResponse'};
    }

    public class GetClient_element {
        public String ClientId;
        private String[] ClientId_type_info = new String[]{'ClientId','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'ClientId'};
    }

    public class AddClient_element {
        public String AccountName;
        public iRT_XIFIN_Client.AdditionalStatementCopyType[] AdditionalStatementCopy;
        public Boolean BillReferralsToClient;
        public iRT_XIFIN_Client.BillingAddressType BillingAddress;
        public String ClientAccountType;
        public String ClientID;
        public String ClientStatementDeliveryMethod;
        public String ClientSubmissionServiceId;
        public iRT_XIFIN_Client.CorrespondenceAddressType CorrespondenceAddress;
        public Boolean DailyCharges;
        public String DailyChargesFrequency;
        public String DailyChargesNotificationMethod;
        public iRT_XIFIN_Client.Questions_element Questions;
        public String NPI;
        public iRT_XIFIN_Client.POs_element POs;
        public String PrimaryFacility;
        public iRT_XIFIN_Client.RefundAddress_element RefundAddress;
        public Date StartDate;
        public String StatementFrequency;
        public iRT_XIFIN_Client.BillingAddressType StreetAddress;
        public String TaxId;
        public iRT_XIFIN_Client.XRefs_element XRefs;
        public String CopyClientId;
        public Boolean copyBillingAddressToShippingAddress;
        public iRT_XIFIN_Client.ShippingAddressType ShippingAddress;
        private String[] AccountName_type_info = new String[]{'AccountName','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] AdditionalStatementCopy_type_info = new String[]{'AdditionalStatementCopy','http://www.xifin.com/schema/client',null,'0','-1','false'};
        private String[] BillReferralsToClient_type_info = new String[]{'BillReferralsToClient','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] BillingAddress_type_info = new String[]{'BillingAddress','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] ClientAccountType_type_info = new String[]{'ClientAccountType','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] ClientID_type_info = new String[]{'ClientID','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] ClientStatementDeliveryMethod_type_info = new String[]{'ClientStatementDeliveryMethod','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] ClientSubmissionServiceId_type_info = new String[]{'ClientSubmissionServiceId','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] CorrespondenceAddress_type_info = new String[]{'CorrespondenceAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] DailyCharges_type_info = new String[]{'DailyCharges','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] DailyChargesFrequency_type_info = new String[]{'DailyChargesFrequency','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] DailyChargesNotificationMethod_type_info = new String[]{'DailyChargesNotificationMethod','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] Questions_type_info = new String[]{'Questions','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] NPI_type_info = new String[]{'NPI','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] POs_type_info = new String[]{'POs','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] PrimaryFacility_type_info = new String[]{'PrimaryFacility','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] RefundAddress_type_info = new String[]{'RefundAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] StartDate_type_info = new String[]{'StartDate','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] StatementFrequency_type_info = new String[]{'StatementFrequency','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] StreetAddress_type_info = new String[]{'StreetAddress','http://www.xifin.com/schema/client',null,'1','1','false'};
        private String[] TaxId_type_info = new String[]{'TaxId','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] XRefs_type_info = new String[]{'XRefs','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] CopyClientId_type_info = new String[]{'CopyClientId','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] copyBillingAddressToShippingAddress_type_info = new String[]{'copyBillingAddressToShippingAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] ShippingAddress_type_info = new String[]{'ShippingAddress','http://www.xifin.com/schema/client',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.xifin.com/schema/client','true','false'};
        private String[] field_order_type_info = new String[]{'AccountName','AdditionalStatementCopy','BillReferralsToClient','BillingAddress','ClientAccountType','ClientID','ClientStatementDeliveryMethod','ClientSubmissionServiceId','CorrespondenceAddress','DailyCharges','DailyChargesFrequency','DailyChargesNotificationMethod','Questions','NPI','POs','PrimaryFacility','RefundAddress','StartDate','StatementFrequency','StreetAddress','TaxId','XRefs','CopyClientId','copyBillingAddressToShippingAddress','ShippingAddress'};
    }

and a method to invoke the service

        public iRT_XIFIN_Client.ResponseMessage_element XIFIN_Request (iRT_XIFIN_Client.MessageHeader_element MessageHeader, iRT_XIFIN_Client.Payload_element Payload) {
            // Create a new SOAP Request (will be sent to XIFIN)
            iRT_XIFIN_Client.RequestMessage_element request_x = new iRT_XIFIN_Client.RequestMessage_element();
            // Create a new SOAP Request Message Header from the parameter             
            request_x.MessageHeader = MessageHeader;
            // Create a new SOAP Request Payload from the parameter             
            request_x.Payload = Payload;
            // Create a new SOAP Response (will receive back from XIFIN)
            iRT_XIFIN_Client.ResponseMessage_element response_x;
            Map<String, iRT_XIFIN_Client.ResponseMessage_element> response_map_x = new Map<String, iRT_XIFIN_Client.ResponseMessage_element>();
            response_map_x.put('response_x', response_x);
            // Invoke the SOAP Web Service
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://www.xifin.com/schema/client',
              'RequestMessage',
              'http://www.xifin.com/schema/client',
              'ResponseMessage',
              'iRT_XIFIN_Client.ResponseMessage_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }

The method takes two parameters: MessageHeader_element and Payload_element

I want to be able to call the Get Client service. This is what the Webservice is expecting to receive in my call

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://www.xifin.com/schema/client" xmlns:msg="http://www.xifin.com/schema/msgHeader">
   <soapenv:Header/>
   <soapenv:Body>
      <cli:RequestMessage>
         <msg:MessageHeader>
            <!--Optional:-->
            <msg:OrganizationName>Demo</msg:OrganizationName>
            <!--Optional:-->
            <msg:SequenceNumber>123</msg:SequenceNumber>
            <msg:UserId>test_user</msg:UserId>
            <!--Optional:-->
            <msg:OrgAlias>demo</msg:OrgAlias>
         </msg:MessageHeader>
         <cli:Payload>
            <cli:GetClient>
               <cli:ClientId>DEOM857612</cli:ClientId>
            </cli:GetClient>
         </cli:Payload>
      </cli:RequestMessage>
   </soapenv:Body>
</soapenv:Envelope>

My issue is: how do I add the service to my payload class? It's unclear to me how I construct the code to decide whish service to invoke (Get Client vs. Add Client) 

IF you have any idea, I'd really appreciate the help
Thanks

Giorgio



 

Hi 
I am using the SOAP API to upsert accounts. The BillingStreet textarea field is giving me problems.
There is a validation rule on the BillingStreet field in SFDC. The validation rule ensures that only 4 address lines are in the field and each line is 40 characters or less. Here is the validation formula:
NOT
(
OR
(
REGEX(BillingStreet, "(.){0,40}"),
REGEX(BillingStreet, "(.){0,40}\r\n(.){0,40}"),
REGEX(BillingStreet, "(.){0,40}\r\n(.){0,40}\r\n(.){0,40}"),
REGEX(BillingStreet, "(.){0,40}\r\n(.){0,40}\r\n(.){0,40}\r\n(.){0,40}")
)
)

The validation works fine when maintaining data in SFDC. It allows up to 4 lines in the field each at 40 characters or less.

I am upserting account data using the SFDC SOAP API and setting the BillingStreet field as follows:
Account.BillingStreet = "123 Main St." (upserts without error with validation rule active)

However, this is what is giving me grief:

Account.BillingStreet = "123 Main St.\r\nPO Box 123"

If I make the validation rule for BillingStreet inactive and upsert the account data, there are no issues. The BillingStreet shows 2 lines in the textarea field as it should.
When the validation rule is active, the upsert fails with the Validation rule error message.

Can anyone tell me how I need to format the BillingStreet value so that it passes the validation rule?

  • October 21, 2010
  • Like
  • 0