• branderTFA
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
When using the Force.com Migration Tool and using the bulkretrieve operation, the package.xml that is generated is not correct, it only populates the XML file with whatever is in the last call. Can this be looked into.

Can anyone tell me if there is a difference between the Metadata API runTests and the Apex API runTest and if you can give me an example of a sample SOAP message of each. Would really appreciate it. Thanks in advance.

When using the Force.com Migration Tool and using the bulkretrieve operation, the package.xml that is generated is not correct, it only populates the XML file with whatever is in the last call. Can this be looked into.
Hi,

Has anyone worked on this before. I am working on integration between Salesforce -CornerStone using CornerStone SOAP API. I have generated apex classes from WSDL. Since, the soap header with username/password information is not generated by wsdl2apex, I have updated the apex classes to include username and password. However, I was able to get the below xml format by updating the apex class.
 
<env:Header> 
<Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 
<UsernameToken> <Username>domainName/username</Username> 
<Password > <value>PSWDXX</value> </Password> 
</UsernameToken> 
</Security> 
</env:Header>

However, the API expects the below XML Request:
 
<o:UsernameToken u:Id="uuid-dd7a656b-27ae-4139-93fe-840d1681bb0e-1">
<o:Username>[CORPNAME]\[WEBSERVICEACCOUNT]</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-username-token-profile-
1.0#PasswordText">password</o:Password>
</o:UsernameToken>

How do I code the apex class inorder to include the password value without the additional <value> PWSDXX </value> tag.

Greatly appreciate any inputs.

APEX CLASS CODE SNIPPET:
 
//soap headers need to be generated and inserted for authentication against WSSE web-services
    public class Security {
    public UsernameToken usernameToken;
    public Security(UsernameToken u){
    	this.usernameToken = u;
    }
    private String[] usernameToken_type_info = new String[]{'UsernameToken','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','UsernameToken','0','1','true'};
    private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
    private String[] field_order_type_info = new String[]{'usernameToken'};
    }
    
    public class UsernameToken {
    public String username;
    public Password password;
    
    public UsernameToken(String username, Password password){
    	this.username = username;
    	this.password = password;
    }
    
    private String[] username_type_info = new String[]{'Username','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','string','0','1','true'};
    private String[] password_type_info = new String[]{'Password','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','string','1','1','true'};
    private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
    private String[] field_order_type_info = new String[]{'username','password'};
    }
    
    public class Password {
    	
    public string Type;
    public string content;
    	
    public Password(String Type, String value){
    		this.Type = Type;
    		this.content = content;
    }
    
    private String[] Type_att_info = new String[]{'Type'};
    private String[] content_type_info = new String[]{'content','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
    private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
    private String[] field_order_type_info = new String[]{'value'};	
    	
    }



Thanks!
  • July 20, 2015
  • Like
  • 0

Can anyone tell me if there is a difference between the Metadata API runTests and the Apex API runTest and if you can give me an example of a sample SOAP message of each. Would really appreciate it. Thanks in advance.

So what I am trying to accomplish is to upsert  List<sObject> with a field specification of what the external Id is. However this is the error message I get back when I try to save the class.

 

List<sObject> newlist = new List<sObject>();

 

upsert newlist ext_Id__c; (Error Msg: "Upsert with a field specification requires a concrete sObject type)

 

 

Any idea of a way around this?