• Arpit Bajpai
  • NEWBIE
  • 45 Points
  • Member since 2016
  • Mr
  • HCL Technologies

  • Chatter
    Feed
  • 1
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
Please Help. Want to remove Namespace from xml tag-<AddressValidationRequest xmlns="http://fedex.com/ws/addressvalidation/v4">

 
XML-
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Header />
   <env:Body>
      <AddressValidationRequest xmlns="http://fedex.com/ws/addressvalidation/v4">
         <WebAuthenticationDetail>
            <UserCredential>
               <Key>*****</Key>
               <Password>****</Password>
            </UserCredential>
         </WebAuthenticationDetail>
         <ClientDetail>
            <AccountNumber>****</AccountNumber>
            <MeterNumber>****</MeterNumber>
            <Localization>
               <LanguageCode>EN</LanguageCode>
               <LocaleCode>us</LocaleCode>
            </Localization>
         </ClientDetail>
         <TransactionDetail>
            <CustomerTransactionId>AddressValidationRequest</CustomerTransactionId>
            <Localization>
               <LanguageCode>EN</LanguageCode>
               <LocaleCode>us</LocaleCode>
            </Localization>
         </TransactionDetail>
         <Version>
            <ServiceId>aval</ServiceId>
            <Major>4</Major>
            <Intermediate>0</Intermediate>
            <Minor>0</Minor>
         </Version>
         <InEffectAsOfTimestamp>2017-05-10T14:30:03.1982091+05:30</InEffectAsOfTimestamp>
         <AddressesToValidate>
            <ClientReferenceId />
            <Contact>
               <PersonName>*****</PersonName>
               <CompanyName>*****</CompanyName>
               <PhoneNumber>*****</PhoneNumber>
               <EMailAddress>*****</EMailAddress>
            </Contact>
            <Address>
               <StreetLines>*****</StreetLines>
               <City>*****</City>
               <StateOrProvinceCode>CA</StateOrProvinceCode>
               <PostalCode>94608</PostalCode>
               <CountryCode>US</CountryCode>
               <Residential>true</Residential>
            </Address>
         </AddressesToValidate>
      </AddressValidationRequest>
   </env:Body>
</env:Envelope>`

WSDL class generated by salesforce-
 
public class AddressValidationRequest {
        public fedexComWsAddressvalidationV4.WebAuthenticationDetail WebAuthenticationDetail;
        public fedexComWsAddressvalidationV4.ClientDetail ClientDetail;
        public fedexComWsAddressvalidationV4.TransactionDetail TransactionDetail;
        public fedexComWsAddressvalidationV4.VersionId Version;
        public String InEffectAsOfTimestamp;
        public fedexComWsAddressvalidationV4.AddressToValidate[] AddressesToValidate;
        private String[] WebAuthenticationDetail_type_info = new String[]{'WebAuthenticationDetail','http://fedex.com/ws/addressvalidation/v4',null,'1','1','false'};
        private String[] ClientDetail_type_info = new String[]{'ClientDetail','http://fedex.com/ws/addressvalidation/v4',null,'1','1','false'};
        private String[] TransactionDetail_type_info = new String[]{'TransactionDetail','http://fedex.com/ws/addressvalidation/v4',null,'0','1','false'};
        private String[] Version_type_info = new String[]{'Version','http://fedex.com/ws/addressvalidation/v4',null,'1','1','false'};
        private String[] InEffectAsOfTimestamp_type_info = new String[]{'InEffectAsOfTimestamp','http://fedex.com/ws/addressvalidation/v4',null,'0','1','false'};
        private String[] AddressesToValidate_type_info = new String[]{'AddressesToValidate','http://fedex.com/ws/addressvalidation/v4',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://fedex.com/ws/addressvalidation/v4','true','true'};
        private String[] field_order_type_info = new String[]{'WebAuthenticationDetail','ClientDetail','TransactionDetail','Version','InEffectAsOfTimestamp','AddressesToValidate'};
    }

    public class AddressValidationServicePort {
        public String endpoint_x = 'https://wsbeta.fedex.com:443/web-services/addressvalidation';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://fedex.com/ws/addressvalidation/v4', 'fedexComWsAddressvalidationV4'};
        public fedexComWsAddressvalidationV4.AddressValidationReply addressValidation(fedexComWsAddressvalidationV4.WebAuthenticationDetail WebAuthenticationDetail,fedexComWsAddressvalidationV4.ClientDetail ClientDetail,fedexComWsAddressvalidationV4.TransactionDetail TransactionDetail,fedexComWsAddressvalidationV4.VersionId Version,String InEffectAsOfTimestamp,fedexComWsAddressvalidationV4.AddressToValidate[] AddressesToValidate) {
            fedexComWsAddressvalidationV4.AddressValidationRequest request_x = new fedexComWsAddressvalidationV4.AddressValidationRequest();
            request_x.WebAuthenticationDetail = WebAuthenticationDetail;
            request_x.ClientDetail = ClientDetail;
            request_x.TransactionDetail = TransactionDetail;
            request_x.Version = Version;
            request_x.InEffectAsOfTimestamp = InEffectAsOfTimestamp;
            request_x.AddressesToValidate = AddressesToValidate;
            fedexComWsAddressvalidationV4.AddressValidationReply response_x;
            Map<String, fedexComWsAddressvalidationV4.AddressValidationReply> response_map_x = new Map<String, fedexComWsAddressvalidationV4.AddressValidationReply>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://fedex.com/ws/addressvalidation/v4/addressValidation',
              'http://fedex.com/ws/addressvalidation/v4',
              'AddressValidationRequest',
              'http://fedex.com/ws/addressvalidation/v4',
              'AddressValidationReply',
              'fedexComWsAddressvalidationV4.AddressValidationReply'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }

​

 
Hello All,
I am getting the below exception when calling a Remote action method 
inside the controller class

Visualforce Remoting Exception: Unexpected character ('n' (code 110)): was expecting double-quote to start field name at [line:1, column:3] 

Code i am using, which is giving error 
Map<String, Object> inputData = (Map<String, Object>)JSON.deserializeUntyped(newCustomerFormJSON);
Hello ,

@CloudCrazeforum
I want to override the standard view of CloudCraze for registration process, to do this i have created my own view and able to render it correctly. Now at the registration step my custom page view is rendered.

Now next thing is i want to call the methods of my CCRZ.subsc.models.CustomComponentModel from my view on submit button click so that i can save the data of that form using my custom controller.

Any help in this will be appriciated.

unable to call the methods of model, which is neccessory to call methods of controller.
Hello Everyone,

I got a email- You have one or more certificates in your Salesforce org that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

I have resolve it using the steps:
There are few places where a sefl-signed certificate could be used, I identified those

1. Identify Provider - If you are using SFDC as IDP for Single Sign On. 
2. Single Sign-On Settings - If you are using SFDC as Consumer for Single Sign On.

Certificate is used in above 2 places, i edit this screen and replace the old certificate, with my newly created Certificate.

When i am doing this changes i have seen the warning msg  "If you change this certificate, users can't connect to service providers until you reconfigure each service provider to work with the new certificate", ANY OTHER PLACES WHERE I HAVE TO UPDATE MY THIS NEW CERTIFICATE?

ANY SUGGESTION HOW TO SOLVE THIS?

Thanks in advance.
Arpit Bajpai
 
Hello Everyone,

I am facing the problem standard quick action on TASK like Change date, edit comment,Change Priority, Change Status ( quick action) are showing two timeswhen we click on show more action in the task page layout salesforce lightning.

I found the solution that we can override the global publisher layout in the task page layout, and remove the duplicate values(Action type is same, only api name is different- which are genrated by system only i did not done any customization).

But my concern is how this duplicate values is created.

Can any one suggest why it happen.

Thanks in advance.
Hello Everyone,

I got a email- You have one or more certificates in your Salesforce org that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

I have resolve it using the steps:
There are few places where a sefl-signed certificate could be used, I identified those

1. Identify Provider - If you are using SFDC as IDP for Single Sign On. 
2. Single Sign-On Settings - If you are using SFDC as Consumer for Single Sign On.

Certificate is used in above 2 places, i edit this screen and replace the old certificate, with my newly created Certificate.

When i am doing this changes i have seen the warning msg  "If you change this certificate, users can't connect to service providers until you reconfigure each service provider to work with the new certificate", ANY OTHER PLACES WHERE I HAVE TO UPDATE MY THIS NEW CERTIFICATE?

ANY SUGGESTION HOW TO SOLVE THIS?

Thanks in advance.
Arpit Bajpai
 
Hello All,
I am getting the below exception when calling a Remote action method 
inside the controller class

Visualforce Remoting Exception: Unexpected character ('n' (code 110)): was expecting double-quote to start field name at [line:1, column:3] 

Code i am using, which is giving error 
Map<String, Object> inputData = (Map<String, Object>)JSON.deserializeUntyped(newCustomerFormJSON);
Hi Friends,
My JSOn is - {"InvalidData"{"userType":null,"status":"success","sessionToken":null,"name":null,"message":"success","mappingId":null,"emailId":null,"data":null,"code":1000}}

But VF is returning - {&quot;InvalidData&quot;:{&quot;userType&quot;:null,&quot;status&quot;:&quot;success&quot;,&quot;sessionToken&quot;:null,&quot;name&quot;:null,&quot;message&quot;:&quot;success&quot;,&quot;mappingId&quot;:null,&quot;emailId&quot;:null,&quot;data&quot;:null,&quot;code&quot;:1000}}


So how to remove this &quot so that I can get the correct JSON as per my class.

My method is as below:
****************************
@RemoteAction
    global static String inValid(integer dataId,boolean contactValid, boolean productValid,
                                 boolean actionValid,String other){
      
       integer contact = 0;
       integer action = 0;
       integer product = 0;
       if(contactValid == true){
        contact = 1;                
       }
       if(productValid == true){
        product = 1;
       }
       if(actionValid == true){
        action = 1;
       }

       SalesAIRecommendations.Item response = new SalesAIRecommendations.Item();
        Recommendation__c recommendation = [SELECT Id,Recom_External_Id__c,Feedback__c FROM Recommendation__c where Recom_External_Id__c =: dataId];
                                            
        if(recommendation != null){
            system.debug('valid recommendation Id');
            recommendation.Feedback__c = other;
            update recommendation;
          
            Invalid_Recommendation__c invRec = new Invalid_Recommendation__c();
            invRec.Recommendation_ID__c = recommendation.Recom_External_Id__c;
            invRec.productChange__c = product;
            invRec.Next_Best_Action__c = action;
            invRec.contactId__c = contact;
            invRec.Others__c = recommendation.Feedback__c;
            insert invRec;
            response.status='success';
            response.code=1000;
            response.message = 'success';
          
            system.debug('{"InvalidData":' + JSON.serialize(response) + '}');
            return '{"InvalidData":' + JSON.serialize(response) + '}';
        }
        else{
            system.debug('invalid recommendation Id');   
            response.status='failure';
            response.code=1001;
            response.message = 'failure';
            system.debug('******:'  + '{"InvalidData":' + JSON.serialize(response) + '}');
            return '{"InvalidData":' + JSON.serialize(response) + '}';
                        
              }
    }
 
  • August 31, 2017
  • Like
  • 0
Hello Everyone,

I got a email- You have one or more certificates in your Salesforce org that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

I have resolve it using the steps:
There are few places where a sefl-signed certificate could be used, I identified those

1. Identify Provider - If you are using SFDC as IDP for Single Sign On. 
2. Single Sign-On Settings - If you are using SFDC as Consumer for Single Sign On.

Certificate is used in above 2 places, i edit this screen and replace the old certificate, with my newly created Certificate.

When i am doing this changes i have seen the warning msg  "If you change this certificate, users can't connect to service providers until you reconfigure each service provider to work with the new certificate", ANY OTHER PLACES WHERE I HAVE TO UPDATE MY THIS NEW CERTIFICATE?

ANY SUGGESTION HOW TO SOLVE THIS?

Thanks in advance.
Arpit Bajpai
 
Hello Everyone,

I am facing the problem standard quick action on TASK like Change date, edit comment,Change Priority, Change Status ( quick action) are showing two timeswhen we click on show more action in the task page layout salesforce lightning.

I found the solution that we can override the global publisher layout in the task page layout, and remove the duplicate values(Action type is same, only api name is different- which are genrated by system only i did not done any customization).

But my concern is how this duplicate values is created.

Can any one suggest why it happen.

Thanks in advance.
Please Help. Want to remove Namespace from xml tag-<AddressValidationRequest xmlns="http://fedex.com/ws/addressvalidation/v4">

 
XML-
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Header />
   <env:Body>
      <AddressValidationRequest xmlns="http://fedex.com/ws/addressvalidation/v4">
         <WebAuthenticationDetail>
            <UserCredential>
               <Key>*****</Key>
               <Password>****</Password>
            </UserCredential>
         </WebAuthenticationDetail>
         <ClientDetail>
            <AccountNumber>****</AccountNumber>
            <MeterNumber>****</MeterNumber>
            <Localization>
               <LanguageCode>EN</LanguageCode>
               <LocaleCode>us</LocaleCode>
            </Localization>
         </ClientDetail>
         <TransactionDetail>
            <CustomerTransactionId>AddressValidationRequest</CustomerTransactionId>
            <Localization>
               <LanguageCode>EN</LanguageCode>
               <LocaleCode>us</LocaleCode>
            </Localization>
         </TransactionDetail>
         <Version>
            <ServiceId>aval</ServiceId>
            <Major>4</Major>
            <Intermediate>0</Intermediate>
            <Minor>0</Minor>
         </Version>
         <InEffectAsOfTimestamp>2017-05-10T14:30:03.1982091+05:30</InEffectAsOfTimestamp>
         <AddressesToValidate>
            <ClientReferenceId />
            <Contact>
               <PersonName>*****</PersonName>
               <CompanyName>*****</CompanyName>
               <PhoneNumber>*****</PhoneNumber>
               <EMailAddress>*****</EMailAddress>
            </Contact>
            <Address>
               <StreetLines>*****</StreetLines>
               <City>*****</City>
               <StateOrProvinceCode>CA</StateOrProvinceCode>
               <PostalCode>94608</PostalCode>
               <CountryCode>US</CountryCode>
               <Residential>true</Residential>
            </Address>
         </AddressesToValidate>
      </AddressValidationRequest>
   </env:Body>
</env:Envelope>`

WSDL class generated by salesforce-
 
public class AddressValidationRequest {
        public fedexComWsAddressvalidationV4.WebAuthenticationDetail WebAuthenticationDetail;
        public fedexComWsAddressvalidationV4.ClientDetail ClientDetail;
        public fedexComWsAddressvalidationV4.TransactionDetail TransactionDetail;
        public fedexComWsAddressvalidationV4.VersionId Version;
        public String InEffectAsOfTimestamp;
        public fedexComWsAddressvalidationV4.AddressToValidate[] AddressesToValidate;
        private String[] WebAuthenticationDetail_type_info = new String[]{'WebAuthenticationDetail','http://fedex.com/ws/addressvalidation/v4',null,'1','1','false'};
        private String[] ClientDetail_type_info = new String[]{'ClientDetail','http://fedex.com/ws/addressvalidation/v4',null,'1','1','false'};
        private String[] TransactionDetail_type_info = new String[]{'TransactionDetail','http://fedex.com/ws/addressvalidation/v4',null,'0','1','false'};
        private String[] Version_type_info = new String[]{'Version','http://fedex.com/ws/addressvalidation/v4',null,'1','1','false'};
        private String[] InEffectAsOfTimestamp_type_info = new String[]{'InEffectAsOfTimestamp','http://fedex.com/ws/addressvalidation/v4',null,'0','1','false'};
        private String[] AddressesToValidate_type_info = new String[]{'AddressesToValidate','http://fedex.com/ws/addressvalidation/v4',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://fedex.com/ws/addressvalidation/v4','true','true'};
        private String[] field_order_type_info = new String[]{'WebAuthenticationDetail','ClientDetail','TransactionDetail','Version','InEffectAsOfTimestamp','AddressesToValidate'};
    }

    public class AddressValidationServicePort {
        public String endpoint_x = 'https://wsbeta.fedex.com:443/web-services/addressvalidation';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://fedex.com/ws/addressvalidation/v4', 'fedexComWsAddressvalidationV4'};
        public fedexComWsAddressvalidationV4.AddressValidationReply addressValidation(fedexComWsAddressvalidationV4.WebAuthenticationDetail WebAuthenticationDetail,fedexComWsAddressvalidationV4.ClientDetail ClientDetail,fedexComWsAddressvalidationV4.TransactionDetail TransactionDetail,fedexComWsAddressvalidationV4.VersionId Version,String InEffectAsOfTimestamp,fedexComWsAddressvalidationV4.AddressToValidate[] AddressesToValidate) {
            fedexComWsAddressvalidationV4.AddressValidationRequest request_x = new fedexComWsAddressvalidationV4.AddressValidationRequest();
            request_x.WebAuthenticationDetail = WebAuthenticationDetail;
            request_x.ClientDetail = ClientDetail;
            request_x.TransactionDetail = TransactionDetail;
            request_x.Version = Version;
            request_x.InEffectAsOfTimestamp = InEffectAsOfTimestamp;
            request_x.AddressesToValidate = AddressesToValidate;
            fedexComWsAddressvalidationV4.AddressValidationReply response_x;
            Map<String, fedexComWsAddressvalidationV4.AddressValidationReply> response_map_x = new Map<String, fedexComWsAddressvalidationV4.AddressValidationReply>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://fedex.com/ws/addressvalidation/v4/addressValidation',
              'http://fedex.com/ws/addressvalidation/v4',
              'AddressValidationRequest',
              'http://fedex.com/ws/addressvalidation/v4',
              'AddressValidationReply',
              'fedexComWsAddressvalidationV4.AddressValidationReply'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }

​

 
Hi,

I am at the step Create a custom classifier/Set up authorization/Generate a JWT token.
When I run the script jwt.sh I get a response:
             Your access token response:
              {"message":"Invalid JWT token"}

I am on win10 64bit but don't have the anniversary update so I don't have bash coming with win10.
I have bash came with git.
As I don't have a valid JWT token I can not continue to "Step 1: Create the Dataset".

Please help.


Here is a more detailed output and my changes to the jwt.sh script:

Script output (with my password changed)


-------------------------------------------------------------------------------------------

$ ./jwt.sh ./00D0Y0000008amn.jks lajos.kelemen@accenture.com 3600 https://api.metamind.io
Enter destination keystore password:  my_pass
Enter source keystore password:  my_pass
Existing entry alias lkelemen_sf_devcert exists, overwrite? [no]:  yes
Entry for alias lkelemen_sf_devcert successfully imported.
Import command completed:  1 entries successfully imported, 0 entries failed or cancelled
[Storing privateKey.p12]
MAC verified OK

Generated Assertion:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJsYWpvcy5rZWxlbWVuQGFjY2VudHVyZS5jb20iLCJzdWIiOiJsYWpvcy5rZWxlbWVuQGFjY2VudHVyZS5jb20iLCJhdWQiOiJodHRwczovL2FwaS5tZXRhbWluZC5pby92MS9vYXV0aDIvdG9rZW4iLCJleHAiOjE0NzYwODAzMTksImlhdCI6MTQ3NjA3NjcxOX0.EcvaPYv3bfA_HNsa_5tNFz6iajvprCee-kNfdSNMPHpgeMgWU3Z0LFt8AojJLNYZIzNydNarDtUbDkqhdpB_c2Ahi2xUhiy_ATnWaUWNrykROsv7dVu_l8smIb9s08N4mcllsDorNWcM9XWmVDlVgq4oegaeQhq2yCOuxn3jAb5IRlurXjSY125FTJs_3oE06vkZYieg6kxQYoeZiWvGfwhdgEB-szutrrXFgUEVKa5U_qj5HFQYlHV7yAcbRTxCc5vOwaAv7qCrjdFCfsmWXPlk-65DSoAFUXK12j6HbB-hHRimNrf-4lLz0mxMmDNC5HuLMHG8BOZMp6PDc19QBg

Your access token response:

{"message":"Invalid JWT token"}

-------------------------------------------------------------------------------------------

my script changes:

openssl pkcs12 -in privateKey.p12 -nocerts -nodes -out private_key
 
changed to (added -passin pass at the end)

openssl pkcs12 -in privateKey.p12 -nocerts -nodes -out private_key -passin pass:my_pass

-------------------------------------------------------------------------------------------
curl -H "Content-type: application/x-www-form-urlencoded" -X POST "$4/v1/oauth2/token" -d \
"grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=$jwt3.$jwt5" ; echo

changed to (added -k parameter to accept self signed certs?)

curl -k -H "Content-type: application/x-www-form-urlencoded" -X POST "$4/v1/oauth2/token" -d \
"grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=$jwt3.$jwt5" ; echo