• mpierce
  • NEWBIE
  • 225 Points
  • Member since 2009

  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 53
    Replies

New to web services, want to make sure I have all this straight.

 

- I grabbed the enterprise wsdl from my salesforce developer account

- Generated the java sources from that wsdl in NetBeans IDE, using jax-ws

- I am able to call login() successfully

- Then in the examples and documentation the SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY on my Soap object needs to be set to the url of the server from the loginResult.

 

- I don't have SoapBindingStub as a generated class.  After looking around on the boards my guess is that this is because I used jax-ws instead of axis 1 to generate the classes.  Is that correct? 

 

- Regenerating the classes with axis 1 would generated the same class names from the examples. Correct?

 

- Since jax-ws doesn't appear to be the class generator used in posts and documentation here, it is going to be a struggle to attempt to figure out what axis 1 classes map to what jax-ws classes.  Correct?

 

Am I in the right jungle?  Thanks for your help.

 

 

  • April 29, 2010
  • Like
  • 0

Hi all,

 

I am currently seeing that for outbound messaging, the fieldsToNull element does not seem to be populated.

The field is indeed on the schema, and I see on other posts that it does get populated. (e.g. http://community.salesforce.com/t5/Java-Development/Outbound-Messaging-Delivery-Status-SOAP-response...).

 

I can't see an obvious configuration change on the Outbound Message that would help. Does anyone know if there is any way of getting fieldsToNull populated ?

 

The net effect seems to be that if a Contact has 10 blank field values, and a new single (11th) field is blanked, the resulting notification will not specify which field was just blanked. It simply omits all the (optional) elements for all 11 blank fields ...

 

Thanks, Conor.

  • April 19, 2010
  • Like
  • 0

Hi, 

 

as opposed to writing java code, I'm using a java-based tool (Oracle BPEL)  for calling the Web Services API. My use-case is simply to bi-directionally synchronize cloud-based Contact data with an in-house Contact Master.

 

For calls inbound to force.com, I have been advised by our force.com consulting partner to use the Partner WSDL (to insulate the middleware from configuration changes in the cloud). I have proof-of-concepted both WSDLs, and they both work fine. However, the partner API seems to me to have little value for my particular use case, as:

 

1) The tool I am using finds it much easier to transform messages when it has source and target XSDs/schemas. However, the Contact object's complex type is only in the Enterprise WSDL schema, and not in the Partner WSDL schema. Although I can use the Enterprise WSDL complex type to build the message and then copy the nodes to the appropriate Partner WSDL node, I don't see the value in that ... why not just use the Enterprise WSDL ?

 

2) Also, this is an in-house development for a single organization. I'm not trying to develop a multi-organizaiton product.

 

3) Finally, it seems to me that if contract-impacting configuration changes to custom fields are made in the Cloud (i.e. such as field renames or field deletes) that strong typing is an advantage - as it's better to fail than have things continue to operate in a possibly unintended fashion. So long as non-mandatory custom field additions in the cloud don't force me to rebuild my integrations, I'm happy, and I believe the Enterprise WSDL will not need to be rebuilt in this case.

 

For the reasons above,  I prefer the advice from salesforce.com at http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_partner.htm

which encourages me to use the Enterprise WSDL for my fairly simple use case. However, as I'm new to force.com, I'm hoping for some validation from some of the experts out there.

 

Thanks, Conor.

 

 

  • April 14, 2010
  • Like
  • 0

Hi there! 

 

I want to get via API the Id of the user that modified an object field (when a field label has been edited for example). How do I do that? describeSObject doesn't give that information.

 

Thanks, JD 

I have a requirement which asks me to retrieve only those records that have been modified after a given day.

 

The problem I have is that I know salesforce stores DateTime fields in UTC format and the Timezone the java code is running from is in PST.

 

how do I form my query?  Should it be in the following way (PST has a -8 difference from UTC time)?

 

select ID from Account where LastModifiedDate > 2009-12-09T00:00:00.000-08:00 

 

This doesn't seem to be retrieving the desired results.  I do understand that the time displayed in sfdc and if I were to query for an accounts LastModifiedDate field would display in the timezone according to my profile.  My profile I am using within Java has a Timezone of PST.  So do I even need to convert the timezone or should the query read as follows instead?

 

select ID from Account where LastModifiedDate > 2009-12-09T00:00:00.000Z

 

Thank you in advance for your responses.  

 

 

 

  • December 10, 2009
  • Like
  • 0

I am fairly new (1 day old :D) to the Java API but have been using Apex,VF for a year now.

 

I have a java method which takes a Date as an input and then uses that date to check for records that have been updated within that day or in the future.  

 

For example if the date I recieve is such: 2009-12-10  I would like my query to function as follows:

 

String myDate = "209-12-10T00:00:00";

qr = binding.query("select ID from account where LastModifiedDate > :myDate");

 

ofcourse 

 

however, I cannot create a DateTime object in java or use a String against a DateTime field.  I have seen the Calendar object but am not sure how this would apply.

 

If anyone could help me formulate this query  that would be greatly appreciated.

 

Also, I need understand there is an issue with time's being checked in UTC?  I would need to check times in PST so how would this affect my query?

 

Thank you in advance to all that help! 

  • December 03, 2009
  • Like
  • 0

Hi,

 

I'm experiencing problems with an invent insertion in the Java api.

 

First I create a new instance of my custom object:



TestPlanScheduleC tps = TestPlanScheduleC.Factory.newInstance();

 

Calendar date = Calendar.getInstance();
date.setTime(getJXDatePicker().getDate());
tps.setDesiredDateC(date);
tps.setTestPlanC(saveResult.getId());
tps.setTestPlanR(TP);

SObject[] tab = { tps };


try
{
sfs.Insert(tab);
if(getJCheckBoxCalendar().isSelected())
{
sfs.addToCalendar(new TreeNodeNID(tps), tps.getTestPlanR().getName(), coverTreeTime(), tps.getDesiredDateC());
}
} catch (RemoteException e2)
{..........




 As you can see, mycustom object is created with a java.util.Calendar, with no problem.

But when I creat my event like this:

 

 

public void addToCalendar(final TreeNodeNID treeNodeNID, final String subject, final double d,
final Calendar startDateTime) throws RemoteException, InvalidSObjectFault, InvalidIdFault,
InvalidFieldFault, UnexpectedErrorFault
{

startDateTime.setTimeZone(null);
Event event = Event.Factory.newInstance();
event.setSubject(subject);
event.setDurationInMinutes((int) d);
event.setStartDateTime(startDateTime);
event.setWhatId(treeNodeNID.getId());

Insert(event);

}

 

 

 

 My Insert function throws an error concerning the same Calendar used in my custom object:

 

 

org.apache.axis2.AxisFault: '2009-08-27+02:00' is not a valid value for the type xsd:dateTime



org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
diva.salesforce.webservice.SforceServiceStub.create(SforceServiceStub.java:2645)
diva.Salesforce_session.Insert(Salesforce_session.java:491)
diva.Salesforce_session.Insert(Salesforce_session.java:542)
diva.Salesforce_session.addToCalendar(Salesforce_session.java:1320)
visual.TestPlanPanel$2.actionPerformed(TestPlanPanel.java:552)
javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
org.jvnet.substance.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:111)
java.awt.Component.processMouseEvent(Unknown Source)
javax.swing.JComponent.processMouseEvent(Unknown Source)
java.awt.Component.processEvent(Unknown Source)
java.awt.Container.processEvent(Unknown Source)
java.awt.Component.dispatchEventImpl(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Window.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)


 

Does someone see the problem here?

All,

 

is it possible to open a session to salesforce, set binding.maintainsession, then open several threads to load data?

Right now it looks as if I woul have to create different id's to load from different machines/fork the process.

 

Any ideas in if multithreading is available on sfdc?

  • August 10, 2009
  • Like
  • 0

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</SessionHeader>
<CallOptions xmlns="http://soap.sforce.com/2006/04/metadata">
<client>...</client>
</CallOptions>
</S:Header>
<S:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Folder">
<fullName>testFolderFullName</fullName>
<accessType>Public</accessType>
<name>testFolderName</name>
</metadata>
</create>
</S:Body>
</S:Envelope>

 

When submitting the above XML, the server responds with a 500 and the following error:

 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

 

 

However, the following xml gets a 200 back (and actually does create the metadata object).

 

 

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</SessionHeader>
<CallOptions xmlns="http://soap.sforce.com/2006/04/metadata">
<client>...</client>
</CallOptions>
</S:Header>
<S:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
<fullName>Lead.foobar__c</fullName>
<label>foo label</label>
<length>28</length>
<type>Text</type>
</metadata>
</create>
</S:Body>
</S:Envelope>

 

 

 

Both requests have the "type" attribute on the "metadata" element in the correct namespace. Any idea why the second works while the first doesn't? (The second does have a "type" sub-element, but that's a property of CustomField specifically.)

 

 

I want to create a new record using the generic SObject as in Partner WSDL, but using Enterprise WSDL. I do not want a strongly typed object, just use the names and match and set it.

On the EnterpriseWSDL the setType is missing so I cannot use the Enterprise Client to create objects just like I can with Partner WSDL.

 

Is there is any solution for this ?

 

I have a swing application where I use JAXWS to generate classes from a salesforce wsdl file.  Everything works fine in my NetBeans environment.

When I package up the software for release, the call to login to the salesforce web service gets the following exception:
url.toString() = file:/C:/Program%20Files/GST/LOB/bin/App.jarException in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
    at com.sun.xml.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1162)
    at com.sun.xml.ws.model.RuntimeModeler.processDocBareMethod(RuntimeModeler.java:1330)
    at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:663)
    at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:420)
    at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:254)
    at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:661)
    at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:649)
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:343)
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:308)
    at javax.xml.ws.Service.getPort(Unknown Source)
    at com.sforce.soap.enterprise.SforceService.getSoap(SforceService.java:74)
    at com.generatedsystems.afs.sf.SfConnector.doLogin(Unknown Source)
    at com.generatedsystems.afs.task.AFSTask.sendDataToSf(Unknown Source)
    at com.generatedsystems.afs.app.AFSExecutableTask.btn1ActionPerformed(Unknown Source)
    at com.generatedsystems.afs.app.AFSExecutableTask.access$200(Unknown Source)
    at com.generatedsystems.afs.app.AFSExecutableTask$3.actionPerformed(Unknown Source)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

So javax.xml.ws.WebFault.messageName() method is not found.  When running in the jre, this class is in rt.jar and indeed that method does not exist in the class.  The correct method exists in a jar file called jaxws-api.jar.  My problem is that even after placing the jar first in my classpath, the jvm still seems to use the WebFault class from the rt.jar.  

After some digging, I think I found the problem, being that rt.jar is part of the delivered jre, the jvm will always choose that jar over one on my classpath.  So then I thought the proper solution was to use the system property java.endorsed.dirs to inform the jvm to use the jar I wanted it to.  This mechanism is described here: http://java.sun.com/javase/6/docs/technotes/guides/standards/

I implemented the setting of that property to my jar and the jvm is still using the WebFault from the rt.jar in the jre.

Am I missing something here?

Thanks for any help.

New to web services, want to make sure I have all this straight.

 

- I grabbed the enterprise wsdl from my salesforce developer account

- Generated the java sources from that wsdl in NetBeans IDE, using jax-ws

- I am able to call login() successfully

- Then in the examples and documentation the SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY on my Soap object needs to be set to the url of the server from the loginResult.

 

- I don't have SoapBindingStub as a generated class.  After looking around on the boards my guess is that this is because I used jax-ws instead of axis 1 to generate the classes.  Is that correct? 

 

- Regenerating the classes with axis 1 would generated the same class names from the examples. Correct?

 

- Since jax-ws doesn't appear to be the class generator used in posts and documentation here, it is going to be a struggle to attempt to figure out what axis 1 classes map to what jax-ws classes.  Correct?

 

Am I in the right jungle?  Thanks for your help.

 

 

  • April 29, 2010
  • Like
  • 0

Hi,

 

I'm using DescribeSObjectResult to retrieve details about Object and its fields.

I noted that the Description property of each field is not available. 

 

I see here

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_describesobjects_describesobjectresult.htm#i1427375

 

Am I missing anything here?

 

What's the reason for not having the description available in API?

 

Thanks

Manuel

Hi all,

 

I am currently seeing that for outbound messaging, the fieldsToNull element does not seem to be populated.

The field is indeed on the schema, and I see on other posts that it does get populated. (e.g. http://community.salesforce.com/t5/Java-Development/Outbound-Messaging-Delivery-Status-SOAP-response...).

 

I can't see an obvious configuration change on the Outbound Message that would help. Does anyone know if there is any way of getting fieldsToNull populated ?

 

The net effect seems to be that if a Contact has 10 blank field values, and a new single (11th) field is blanked, the resulting notification will not specify which field was just blanked. It simply omits all the (optional) elements for all 11 blank fields ...

 

Thanks, Conor.

  • April 19, 2010
  • Like
  • 0

Hi, 

 

as opposed to writing java code, I'm using a java-based tool (Oracle BPEL)  for calling the Web Services API. My use-case is simply to bi-directionally synchronize cloud-based Contact data with an in-house Contact Master.

 

For calls inbound to force.com, I have been advised by our force.com consulting partner to use the Partner WSDL (to insulate the middleware from configuration changes in the cloud). I have proof-of-concepted both WSDLs, and they both work fine. However, the partner API seems to me to have little value for my particular use case, as:

 

1) The tool I am using finds it much easier to transform messages when it has source and target XSDs/schemas. However, the Contact object's complex type is only in the Enterprise WSDL schema, and not in the Partner WSDL schema. Although I can use the Enterprise WSDL complex type to build the message and then copy the nodes to the appropriate Partner WSDL node, I don't see the value in that ... why not just use the Enterprise WSDL ?

 

2) Also, this is an in-house development for a single organization. I'm not trying to develop a multi-organizaiton product.

 

3) Finally, it seems to me that if contract-impacting configuration changes to custom fields are made in the Cloud (i.e. such as field renames or field deletes) that strong typing is an advantage - as it's better to fail than have things continue to operate in a possibly unintended fashion. So long as non-mandatory custom field additions in the cloud don't force me to rebuild my integrations, I'm happy, and I believe the Enterprise WSDL will not need to be rebuilt in this case.

 

For the reasons above,  I prefer the advice from salesforce.com at http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_partner.htm

which encourages me to use the Enterprise WSDL for my fairly simple use case. However, as I'm new to force.com, I'm hoping for some validation from some of the experts out there.

 

Thanks, Conor.

 

 

  • April 14, 2010
  • Like
  • 0

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</SessionHeader>
<CallOptions xmlns="http://soap.sforce.com/2006/04/metadata">
<client>...</client>
</CallOptions>
</S:Header>
<S:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Folder">
<fullName>testFolderFullName</fullName>
<accessType>Public</accessType>
<name>testFolderName</name>
</metadata>
</create>
</S:Body>
</S:Envelope>

 

When submitting the above XML, the server responds with a 500 and the following error:

 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

 

 

However, the following xml gets a 200 back (and actually does create the metadata object).

 

 

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</SessionHeader>
<CallOptions xmlns="http://soap.sforce.com/2006/04/metadata">
<client>...</client>
</CallOptions>
</S:Header>
<S:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
<fullName>Lead.foobar__c</fullName>
<label>foo label</label>
<length>28</length>
<type>Text</type>
</metadata>
</create>
</S:Body>
</S:Envelope>

 

 

 

Both requests have the "type" attribute on the "metadata" element in the correct namespace. Any idea why the second works while the first doesn't? (The second does have a "type" sub-element, but that's a property of CustomField specifically.)

Hi there! 

 

I want to get via API the Id of the user that modified an object field (when a field label has been edited for example). How do I do that? describeSObject doesn't give that information.

 

Thanks, JD 

When logging into salesforce through the API, is there any way that we can encrypt the password?  It appears to be sending it across as plain text.

 

Thanks.

  • March 11, 2010
  • Like
  • 0

I'm doing a query to pull a few hundred thousand records from a custom object and I'm noticing duplicate rows being pulled down.  I'm sure this is something I'm doing wrong, but I'm using the queryMore sample code provided in the wiki

 

 

QueryResult queryResult = this.stub.query("Select name From lead"); do { for(sObject lead : queryResult.getRecords()) { System.out.println(lead.get_any()[0].getValue()); } if(queryResult.isDone()) break; queryResult = this.stub.queryMore(queryResult.getQueryLocator()); } while(true);

 

 I am performing a few different queries within my class, so I'm repurposing queryResult, but I'm setting it to null before every query.

 

Any help is appreciated!

 

I am developing a Java application which will query tables which may hold over 1,000,000 records.  I have tried everything I could to be as efficient as possible but I am only able to achieve on avg. about 5,000 records a minute and a maximum of 10,000 at one point.  I have tried reverse engineering the data loader and my code seems to be very similar but still no luck.

 

Is threading a viable solution here? I have tried this but with very minimal results.  

 

I have been reading and have applied every thing possible it seems (compressing requests/responses, threads etc.) but I cannot achieve data loader like speeds.  

 

To note, it seems that the queryMore method seems to be the bottle neck.

 

Does anyone have any code samples or experiences they can share to steer me in the right direction?

 

Thanks 

  • February 10, 2010
  • Like
  • 0

I have a requirement which asks me to retrieve only those records that have been modified after a given day.

 

The problem I have is that I know salesforce stores DateTime fields in UTC format and the Timezone the java code is running from is in PST.

 

how do I form my query?  Should it be in the following way (PST has a -8 difference from UTC time)?

 

select ID from Account where LastModifiedDate > 2009-12-09T00:00:00.000-08:00 

 

This doesn't seem to be retrieving the desired results.  I do understand that the time displayed in sfdc and if I were to query for an accounts LastModifiedDate field would display in the timezone according to my profile.  My profile I am using within Java has a Timezone of PST.  So do I even need to convert the timezone or should the query read as follows instead?

 

select ID from Account where LastModifiedDate > 2009-12-09T00:00:00.000Z

 

Thank you in advance for your responses.  

 

 

 

  • December 10, 2009
  • Like
  • 0

I need to push large files to Content folder to salesforce.com using the java API. I'm passing data to salesforce.com using SOAP messages.

 

I'm able to push files upto 7MB but if I push the files larger than 7MB I get the following error

java.lang.OutOfMemoryError: Java heap space

 

I have increased the heap size to 1024MB but of no use. The eclipse.ini file looks like 

 

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx1024m
-XX:PermSize=64M
-XX:MaxPermSize=128M

 

Can someone please suggest how can this problem be resolved.

 

I am fairly new (1 day old :D) to the Java API but have been using Apex,VF for a year now.

 

I have a java method which takes a Date as an input and then uses that date to check for records that have been updated within that day or in the future.  

 

For example if the date I recieve is such: 2009-12-10  I would like my query to function as follows:

 

String myDate = "209-12-10T00:00:00";

qr = binding.query("select ID from account where LastModifiedDate > :myDate");

 

ofcourse 

 

however, I cannot create a DateTime object in java or use a String against a DateTime field.  I have seen the Calendar object but am not sure how this would apply.

 

If anyone could help me formulate this query  that would be greatly appreciated.

 

Also, I need understand there is an issue with time's being checked in UTC?  I would need to check times in PST so how would this affect my query?

 

Thank you in advance to all that help! 

  • December 03, 2009
  • Like
  • 0

Hi

 

I have an requirement to compare createddate with system date. I know in Apex coding we can do using system.today() method.

 

In Java, I have query on case object. this query should retrive the records created on that day itself.

 

my query is

 

binding.query("select id,CaseNumber,BRAND_del__c,Account.City_dealer__c,Tenure__c,Account.Dealer_Code_FINNONE__c,Mobile__c,Age__c,Gross_Loan_Amount__c,Advanced_EMI_Amount__c,CreatedDate from Case where Count_of_Fraud_Records__c=0 and CreatedDate=system.today() limit 1");

 

Can you please help me in writing this filter condition?

 

Thanks in advance.

 

Regards,

Swaran

 

 

 

  • November 26, 2009
  • Like
  • 0

Hi,

 

We have a client application that connects with salesforce though the API to insert/update data.

Salesforce was down for a few minutes the other day and we saw in the logs the following messages:

 

"SERVER_UNAVAILABLE: server temporarily unavialable, SERVER_UNAVAILABLE: server temporarily unavialable"

 

But I am wondering which of the following exceptions were thrown (the exception "name" wasn't tracked in the logs):

 

<operation name="update">

<documentation>Update a set of sObjects</documentation>

<input message="tns:updateRequest"/>

<output message="tns:updateResponse"/>

<fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>

<fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>

<fault message="tns:InvalidIdFault" name="InvalidIdFault"/>

<fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>

</operation>

 

Before Salesforce went down our client application was already logged in so the only API call made repeatedly during the downtime period was an "update"

 

Is there a way to know which exceptions are thrown only thrown when there is a problem with the server (transit error)? so we can resend the message?

 

we need to make a distinction when the exception is thrown because of bad data or when it is a transit error due to server issue. If it is because of bad data, we prefer to log an error rather than retry again and again.

 

Could you please help here?

 

  • November 25, 2009
  • Like
  • 0