• marshallpierce
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I've released a new library that exposes a cleaner interface to the Salesforce APIs. There's a blog post introducing it: http://blog.teamlazerbeez.com/2011/03/03/a-new-java-salesforce-api-library/ Check it out and let me know what you think.

I've looked at describeMetadata, listMetadata, and retrieve in the metadata API with no luck. What I'm after is the data you see on the Installed Pacakges page in the Setup interface. ApexClass does contain a PackageVersions[] field, but it's not visible in the results I get out of retrieve. 

Dear All,

 

If i need to update a list of WorkflowRule objects using the Metadata api update() method, do i need to create the Workflow objects to hold the list of WorkflowRule objects belong to a Workflow file?

 

At the moment, i'm parsing in a list of workflow xml files retrieved using an Ant script and created a list of WorkflowRule objects. After that i put the list into an UpdateMetadata[] array. However, i'm getting the following errors:

 

Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element

 

Anyone could give me some inputs for what i might be missing would be great.

 

Thank you so much for your help in advance.

 

Best Regards,

Motoki

  • September 14, 2010
  • Like
  • 0

Hello all.

 

I'm experiementing with creating my own webservice classes on force.com.

 

I have created my own Apex class and marked it as a web  service.

I've generated the WSDL and created a client in Netbeans using its JAX-WS tooling.

 

I have attempted to run this web service and run into the 'missing Session ID' problem.

 

To avoid this, I have generated the Partner WSDL and created additional client stubs for the Partner client, I've then executed the login method on the Partner ID and obtained a valid session Id string.

 

My issue is now a JAX-WS issue, how do I inject this session ID into the client I use to assess my own webservice class?  I can find no method / object to do this.  There is a 'SessionHeader' class in my custom client which I can call a 'setSessionId()' method on, but I can't figure out how to inject my SessionHeader into my port/service.

 

I'm not a WS guru... so is there something I'm missing?

 

 

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication3;

import enterprise.InvalidIdFault_Exception;
import enterprise.LoginFault_Exception;
import enterprise.LoginResult;
import enterprise.UnexpectedErrorFault_Exception;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.handler.PortInfo;

/**
 *
 * @author sherod
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            LoginResult r = login("xxxx", "xxxx");
   

            myMethod(r.getSessionId(),null);
        } catch (InvalidIdFault_Exception ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnexpectedErrorFault_Exception ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (LoginFault_Exception ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    private static LoginResult login(java.lang.String username, java.lang.String password) throws InvalidIdFault_Exception, UnexpectedErrorFault_Exception, LoginFault_Exception {
        enterprise.SforceService service = new enterprise.SforceService();
        enterprise.Soap port = service.getSoap();
        return port.login(username, password);
    }

    private static TestData myMethod(String sessId, javaapplication3.TestData t) {
        javaapplication3.MyWebServiceService service = new javaapplication3.MyWebServiceService();

        javaapplication3.SessionHeader sh = new javaapplication3.SessionHeader();
        sh.setSessionId(sessId);
        System.out.println(sessId);  //session ID output, but where to I send 'sh'?


        javaapplication3.MyWebServicePortType port = service.getMyWebService();

        return port.myMethod(t);
    }

}

 

 

  • August 16, 2010
  • Like
  • 0