• pl
  • NEWBIE
  • 0 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 15
    Replies

I am running axis demo (java), exception occurs when run describe entity for entity mailmergeTemplate .

 

I believe mailmergeTemplate  is new entity. Did I miss anything.

 

Thanks

  • October 16, 2003
  • Like
  • 0

Hi,

I am runing Axis demos (java). I  did update first and then did query by Filter.

My filter is lastModifiedDate is "less than" end date which is current time and "greater than" start date which is current time - 30 second.

I noticed (I tried many times)  that even the lastModifiedDate is between the current time and current time - 30 second. query will not get the updated object. but if my start date is current time - 30 second - 60 second. I can get the object if I do query by Filter within 30 second after I did update.

current time - 30 second - 60 second <lastModifiedDate < current time

So why need 60 second .

I call get_server_timestamp to get server time and it is same as my local time (GMT)

I am thinking this many days and don't know why.

 

 

 

  • August 18, 2003
  • Like
  • 0

Hi,

Sometimes when I try to login (I run Axis java demos) , I got the exception

untrusted server cert chain.

I use SSL implementation from Sun. (Sun seems to ship JVMs with certs from Verisign ang Thawte). My understanding is if the certificates received is unknown to the trust mechanism because the wrong trust file is loaded, I will got this exception.

Do you have any idea.

Thank you

 

peilei

 

 

 

  • August 14, 2003
  • Like
  • 0

Hi,

I am running Axis demo(java). After I insert a account , I got "insert new account, id : 00130000000hFkU, ...

 

But when I do query, I got " field : id has the value of 00130000000hFkUAAU.

 

There are 3 chars append to the id. I am wondering why. Anybody else notice this behaior ?

 

Thanks.

  • August 13, 2003
  • Like
  • 0

Hi,

 

It looks like I can't use any of https://... .

What I need to do to fix this.

 

Thanks.

 

  • August 01, 2003
  • Like
  • 0

I am using APache soap v2 API , here is the piece of code

I got exception - need deseriablizer for a "salesforec:map"

 

Could you help me out

String endPointURL = "http://www.salesforce.com/servlet/servlet.SoapApi";

//build soap call object
String encodingStyleURI
= Constants.NS_URI_SOAP_ENC; //should get from propperties
try {
url
= new URL(endPointURL);
}
catch (Exception e){};

System.out.println(
"url "+url);
SOAPMappingRegistry smr
= new SOAPMappingRegistry ();
//MapSerializer sd = new MapSerializer ();
MapEntrySerializer sd
= new MapEntrySerializer ();

smr.mapTypes (Constants.NS_URI_SOAP_ENC,
new QName ("", "return"),MapEntry.class, sd, sd);


// Build the call.
Call call
= new Call();

call.setTargetObjectURI(
"sfconnector:SalesforceConnector");
call.setMethodName(
"login");
call.setEncodingStyleURI(encodingStyleURI);
call.setSOAPMappingRegistry (smr);


Vector params
= new Vector();
params.addElement(
new Parameter("version", String.class,
"1.9", null));
params.addElement(
new Parameter("username", String.class,
"rthurston@aptsoft.com", null));
params.addElement(
new Parameter("password", String.class,
"Aptsoft", null));
params.addElement(
new Parameter("secure", java.lang.Boolean.class,
(Boolean)(
new Boolean(false)),null));
params.addElement(
new Parameter("remoteApplication", String.class,
"myApp", null));


call.setParams(params);
System.out.println(
"params set "+call.toString());


// Invoke the call.
Response resp;
try {
resp
= call.invoke(url, "");
MapEntry me
= (MapEntry)resp.getReturnValue().getValue();
String sid
= (String)me.getValue();
}
catch (SOAPException e){
System.out.println(
"Caught SOAPException (" +
e.getFaultCode()
+ "): " +
e.getMessage());
return false;
}

// Check the response.
if (!resp.generatedFault()) {
return true;

}
else {

Fault fault
= resp.getFault();

System.out.println(
"Generated fault: ");
System.out.println(
" Fault Code = " + fault.getFaultCode());
System.out.println(
" Fault String = " + fault.getFaultString());
return true;

}

  • July 30, 2003
  • Like
  • 0

So far I read all discussion are about client using Axis and web service pack . I would like to know is there any reason about this.

 

peilei

  • July 30, 2003
  • Like
  • 0

Hi,

Our product use soap 2.2 and no intention to upgrade to Axis. Could I use soap 2.2 to use APIs 2.0. and How ?

 

Thanks

peilei

  • July 28, 2003
  • Like
  • 0

Hi,

 

The xmlrpc.jar file of SalesForce.com is not the same xmlrpc.jar from xmlrpc.org. I read somewhere you don't support xml-rpc client. we already did a lot of work using xmlrpc.jar. what we should do.

 

peilei

  • July 25, 2003
  • Like
  • 0

Hi,

I notice the time in sforce and my local time is 4 hours difference. I assume you use GMT. My problem is when I create filter using field "lastModifiedDate". I have to do the hack: added 4 hours to my startDate and endDate because it only take Java Date object as "value". Any solution for me. I don't like the hack but I do need this to be solved in a nice way.


Date startDate = new Date(startDate.getTime()+14400000);

Date startDate = new Date(endDate.getTime()+14400000);



Vector filter
= new Vector();

Hashtable h1
= new Hashtable();
//first
h1.put(
"field", "lastModifiedDate");
h1.put(
"operator", "greater than");
h1.put(
"value", startDate);
//second
Hashtable h2
= new Hashtable();
h2.put(
"field","lastModifiedDate");
h2.put(
"operator","less than");
h2.put(
"value", endDate);

Vector filterVec
= new Vector();
filterVec.add(h1);
filterVec.add(h2);
//first and second
Hashtable h
= new Hashtable();
h.put(
"operator","and");
h.put(
"value", filterVec);

filter.add(h);

  • July 25, 2003
  • Like
  • 0

Hi,

What key words to look for in exception to know that the session expire and need to relogin

Thanks.

peilei

 

  • July 24, 2003
  • Like
  • 0
After I make describe call and I got some strange field names in some entities such as 00N00000006FCZ7. It is valid field name ?. It disapear in next describe call sometimes .
  • June 27, 2003
  • Like
  • 0

Hi,

I am running Axis demo(java). After I insert a account , I got "insert new account, id : 00130000000hFkU, ...

 

But when I do query, I got " field : id has the value of 00130000000hFkUAAU.

 

There are 3 chars append to the id. I am wondering why. Anybody else notice this behaior ?

 

Thanks.

  • August 13, 2003
  • Like
  • 0

Hello,

I'm trying to insert an opportunity via the API. The amount field has a double data type. In my code I have a double variable with the value 1000, just like this:  

double a=1000;

When I excute the insert call with the parameter above, I get this error:

XMLException: helma.xmlrpc.XmlRpcException: Value 1000.0 not of required type double on field amountcode: 1212

I don't why, my parameter "a" has the right data type, so why is my code not working ??

Regards,

sfDeveloper

 

Hi,

 

It looks like I can't use any of https://... .

What I need to do to fix this.

 

Thanks.

 

  • August 01, 2003
  • Like
  • 0

I recently upgraded code to version 2.0 of the salesforce api.  I downloaded the sfdcdemo.java file from the sforce website, edited the sfdcdemo.prop file to add my account info and compiled and ran the code.  I got the following error, having made no changes to the .java file:

Login call successful, session_id: 968xRtb75xQWzUYYCSwNN7xPWOZdR2dQRopgHDRrp3o4l
VM5Ug95efG6fnr1Ydvqyn_r7bSk1w.hZfYqaLHMKvbtzKggVlhL

Describe Params
[{version=2.0, type=global}]

Exception in thread "main" helma.xmlrpc.XmlRpcException: unknown method name des
cribe
        at helma.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:174)
        at helma.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:79)
        at helma.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:64)
        at sfdcdemo.main(sfdcdemo.java:183)

I encounter the unknown method exception with the search and logout methods as well. 

 

 

  • July 31, 2003
  • Like
  • 0

Hi,

Our product use soap 2.2 and no intention to upgrade to Axis. Could I use soap 2.2 to use APIs 2.0. and How ?

 

Thanks

peilei

  • July 28, 2003
  • Like
  • 0

Hi,

 

The xmlrpc.jar file of SalesForce.com is not the same xmlrpc.jar from xmlrpc.org. I read somewhere you don't support xml-rpc client. we already did a lot of work using xmlrpc.jar. what we should do.

 

peilei

  • July 25, 2003
  • Like
  • 0

Hi,

What key words to look for in exception to know that the session expire and need to relogin

Thanks.

peilei

 

  • July 24, 2003
  • Like
  • 0

The return value of xmlrpc_login doesn't contain the correct server_url. 

  Hashtable result = (Hashtable) xmlrpc_login.execute("sfdc.login", loginParms);

  myServer = (String) result.get("server_url");

  xmlrpc = new XmlRpcClient(myServer);

The value of myServer is https://na1-api.salesforce.com/servlet/servlet.Api. But I found I can only

make it work with http://na1-api.salesforce.com/servlet/servlet.Api. Otherwise it says "unknown protocol: https".


 


http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap
enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="salesforce" xmlns:typ
es="salesforce/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instanc
e" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
 
 
  
    00130000000aiGh  <== NOTE: correct, when used in browser
    00130000000aLw8  <== NOTE: correct, when used in browser
  
 
 

SForce.search: iterating over child-elements
SForce.search: found RETURN-element
SForce.search: iterating over RETURN-element's children
java.lang.Exception: forcing, to find all callers
        at test.api.SForceUtil.getObject(SForceUtil.java:91)
        at test.api.SForce.search(SForce.java:275)
        at test.api.SForce.main(SForce.java:433)
element-name: valueArray
attrib-name: xsi:type
attrib-val: tns:array
SForceUtil.getObject: type: null
SForceUtil.getObject: typeName: com.sun.xml.messaging.saaj.soap.dom4j.NameImpl@2
b8e6266 [name: xsi:type namespace: "org.dom4j.Namespace@babe [Namespace: prefix
 mapped to URI ""]"]
SForceUtil.getObject: about to return: null
SEARCH RESULTS
java.lang.NullPointerException
        at test.api.SForce.search(SForce.java:281)
        at test.api.SForce.main(SForce.java:433)

>

============================================

(from: SForce.java)

    public SForce(String version, String url) throws MalformedURLException, SOAPException {
        SOAPMessage msg = createMessage();
        SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
        this.typeName = env.createName(TYPE_LOCAL);
        qtypeName = env.createName(TYPE_QUALIFIED);  <== NOTE: added (stored staticly)

        this.urlObj = new URL(url);
        this.version = version;
    }

...

/*
System.out.println(response.toString());

Iterator iter = response.getMimeHeaders().getAllHeaders();

while(iter.hasNext()) { // this did show "Content-Type: text/xml"; docs say should be "text/xylem" ?
    MimeHeader h = (MimeHeader)iter.next();
    System.out.println(h.getName() + ": " + h.getValue());
}
*/              
            SOAPEnvelope respenv = response.getSOAPPart().getEnvelope();         
            respbody = respenv.getBody();
/*
System.out.println(respbody.toString());
*/

            // The processing below is typical for the responses returned by the SOAP API, Use SForceUtil to create on object to hold response
            Object result = null;
            for (Iterator i = respbody.getChildElements(); i.hasNext() {
System.out.println("SForce.search: iterating over child-elements");
                SOAPElement element = (SOAPElement) i.next();
                if (element.getElementName().getLocalName().equals(RETURN)) {
System.out.println("SForce.search: found RETURN-element");
                    for (Iterator j = element.getChildElements(); j.hasNext() {
System.out.println("SForce.search: iterating over RETURN-element's children");
                        SOAPElement next = (SOAPElement) j.next();
                        //result = SForceUtil.getObject(next, this.typeName);
                        result = SForceUtil.getObject(next, SForce.qtypeName);
                    }
                }
            }
            // search returns a List
            System.out.println("SEARCH RESULTS");
            for (Iterator i = ((List)result).iterator(); i.hasNext() {
                System.out.println("Account ID: " + (String)i.next());
            }
            System.out.println();

 

(from: SForceUtil.java)

    // Utility function to traverse SOAP response
    public static Object getObject(SOAPElement element, Name typeName) {
       
try {  // I did this, to find out who was calling this method first; turns out it was the "describe"-method; seems inconsequential for this problem -- maybe not?
    throw new Exception("forcing, to find all callers");
} catch(Exception e) {
    e.printStackTrace();
}
       
        Object obj = null;
       
System.out.println("element-name: " + element.getElementName().getQualifiedName());
       
        String type = element.getAttributeValue(typeName);
Iterator iter = element.getAllAttributes();
while(iter.hasNext()) {
    Name name = (Name)iter.next();
    System.out.println("attrib-name: " + name.getQualifiedName());
    System.out.println("attrib-val: " + element.getAttributeValue(name));
}

System.out.println("SForceUtil.getObject: type: " + type);
System.out.println("SForceUtil.getObject: typeName: " + typeName.toString());
       
        if (type != null) {
            if (type.equals(INTEGER)) {
                obj = new Integer(element.getValue());
            } else if (type.equals(BOOLEAN)) {
                obj =  Boolean.valueOf(element.getValue().equals("true"));
            } else if (type.equals(MAP)) {
                obj = getMap(element, typeName);
            } else if (type.equals(ARRAY)) {
System.out.println("SForceUtil.getObject: type=ARRAY");
                obj = getList(element, typeName);
            } else {
                obj = element.getValue();
            }
        }
System.out.println("SForceUtil.getObject: about to return: " + obj);       

       
        return obj;
    }

i've downloaded the java toolkit and set everything up as instructed. when the sample program runs, i get an error after the login:

SEARCH RESULTS
java.lang.NullPointerException
        at test.api.SForce.search(SForce.java:264)
        at test.api.SForce.main(SForce.java:399)

i put a statement in the SForce class

           for (Iterator j = element.getChildElements(); j.hasNext() {
                     SOAPElement next = (SOAPElement) j.next();
                     result = SForceUtil.getObject(next, this.typeName);
                    System.out.println("result is"+result);
                 }

which prints out "result is null" when the sample is run

my understanding is that the sample searches for accounts with the word "test" in some field. i've put the word "test" in the website field of 3 accounts.

so i'm wondering what the problem is. has anyone got the toolkit to run properly? what needs to be put in the account fields?

Message Edited by pninth on 07-01-2003 10:29 AM

After I make describe call and I got some strange field names in some entities such as 00N00000006FCZ7. It is valid field name ?. It disapear in next describe call sometimes .
  • June 27, 2003
  • Like
  • 0