• DJH
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 16
    Replies
I'm using the 4.0 API under Java, not that it matters for this....

I want to select all leads in the US which do not have a two-character state code in the state column. In other words, "select company, city, state from lead where country='USA' and length(state) != 2". However, the Salesforce SOQL doesn't seem to have a "length" function.

So alternatively I would like to do something like this: "select company, city, state from lead where country='USA' and state not in ('AL' 'AK' ... 'WY')". However, the Salesforce SOQL doesn't seem to support this syntax, either.

So how can I accomplish this?

DJH
  • October 06, 2004
  • Like
  • 0
I'm pretty new to JSPs so that may be part of my problem, here, but there's no documentation at all on how one should tie the pieces of the "jsp-sample" together to make a working JSP application. They don't seem to relate to each other.

First of all, session.jsp is 100% Java, no HTML content. Why? Shouldn't its content be somewhere else instead? Also, it doesn't seem to be invoked by anything.

Secondly, GettingStartedEclipse.html. What's this for?

Thirdly, when I attempt to use login.jsp by entering a username and password and clicking the login button, what I get is "No file exists at the address "Salesforce/jsp-sample/Web Root/button cause an action to go out and attempt to login to the Salesforce web service?

I was hoping this JSP example was basically a JSP version of the straight-Java Quickstart example but it's not. Is there such an animal?

Please help....

DJH

Message Edited by DJH on 09-24-2004 05:09 PM

  • September 25, 2004
  • Like
  • 0
I'm running Mac OS X 10.3.4 and Eclipse 3.0.0. I just downloaded the
Eclipse WSDL2Java plugin (com.myspotter.wsdl2java_1.2.0) from
http://sourceforge.net/projects/sforce. But I can't get Eclipse to install
it! I get an alert panel saying "Selected location does not contain an
update site. Please select another location."

The plugin folder contains the following files:

axis-ant.jar
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
log4j-1.2.8.jar
plugin.xml
saaj.jar
wsdl2java.jar
wsdl4j.jar

I've also tried dropping the folder into Eclipse's plugins directory.

What else can I try?

DJH
  • July 22, 2004
  • Like
  • 0
When I run my Java app to connect to Salesforce, I get an INVALID_LOGIN exception, even though I am using my developer account login and password, which obviously logged me in just fine via the web because here I am. I am using Java 1.4.2, Axis 1.0 (I cannot upgrade to 1.1 without risking breakage of other stuff, sorry) and the Sforce 3.0 API. My password contains no special characters. What could be wrong?

DJH
  • July 21, 2004
  • Like
  • 0
I'm trying to duplicate the sample project, using my company's WSDL. I ran the WSDL document through WSDL2Java to get the appropriate classes.

First problem: _QueryOptions and _SessionHeader were not generated. I worked around this by swiping them from the sample project, since they should be the same for all customers.

Second problem: when I compile, I get the following errors:

AccessSforce1.java:182: cannot resolve symbol
symbol : method setHeader (java.lang.String,java.lang.String,com.sforce.soap.enterprise._SessionHeader)
AccessSforce1.java:469: cannot resolve symbol
symbol : method setHeader (java.lang.String,java.lang.String,com.sforce.soap.enterprise._QueryOptions)

The first error is at this part of my application source code, which is verbatim from the example code:

//Create a new session header object and set the session id to that returned by the login
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(loginResult.getSessionId());
binding.setHeader("SforceService", "SessionHeader", sh);

The second error is also an invocation of binding.setHeader:

_QueryOptions qo = new _QueryOptions();
qo.setBatchSize(new Integer(3));
binding.setHeader("SoapService", "QueryOptions", qo);

It seems from the code that setHeader() is supposed to be a method in SforceServiceLocator, or its superclass org.apache.axis.client.Service. But there's no such method.

I'm running Java 1.4.2 and I have Axis 1.1.

How do I get this to work? Is there an implementation for setHeader() (and presumably getHeader() available)?

DJH
  • July 03, 2004
  • Like
  • 0
I'm using the 4.0 API under Java, not that it matters for this....

I want to select all leads in the US which do not have a two-character state code in the state column. In other words, "select company, city, state from lead where country='USA' and length(state) != 2". However, the Salesforce SOQL doesn't seem to have a "length" function.

So alternatively I would like to do something like this: "select company, city, state from lead where country='USA' and state not in ('AL' 'AK' ... 'WY')". However, the Salesforce SOQL doesn't seem to support this syntax, either.

So how can I accomplish this?

DJH
  • October 06, 2004
  • Like
  • 0
I'm pretty new to JSPs so that may be part of my problem, here, but there's no documentation at all on how one should tie the pieces of the "jsp-sample" together to make a working JSP application. They don't seem to relate to each other.

First of all, session.jsp is 100% Java, no HTML content. Why? Shouldn't its content be somewhere else instead? Also, it doesn't seem to be invoked by anything.

Secondly, GettingStartedEclipse.html. What's this for?

Thirdly, when I attempt to use login.jsp by entering a username and password and clicking the login button, what I get is "No file exists at the address "Salesforce/jsp-sample/Web Root/button cause an action to go out and attempt to login to the Salesforce web service?

I was hoping this JSP example was basically a JSP version of the straight-Java Quickstart example but it's not. Is there such an animal?

Please help....

DJH

Message Edited by DJH on 09-24-2004 05:09 PM

  • September 25, 2004
  • Like
  • 0
I'm running Mac OS X 10.3.4 and Eclipse 3.0.0. I just downloaded the
Eclipse WSDL2Java plugin (com.myspotter.wsdl2java_1.2.0) from
http://sourceforge.net/projects/sforce. But I can't get Eclipse to install
it! I get an alert panel saying "Selected location does not contain an
update site. Please select another location."

The plugin folder contains the following files:

axis-ant.jar
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
log4j-1.2.8.jar
plugin.xml
saaj.jar
wsdl2java.jar
wsdl4j.jar

I've also tried dropping the folder into Eclipse's plugins directory.

What else can I try?

DJH
  • July 22, 2004
  • Like
  • 0
When I run my Java app to connect to Salesforce, I get an INVALID_LOGIN exception, even though I am using my developer account login and password, which obviously logged me in just fine via the web because here I am. I am using Java 1.4.2, Axis 1.0 (I cannot upgrade to 1.1 without risking breakage of other stuff, sorry) and the Sforce 3.0 API. My password contains no special characters. What could be wrong?

DJH
  • July 21, 2004
  • Like
  • 0
I'm trying to duplicate the sample project, using my company's WSDL. I ran the WSDL document through WSDL2Java to get the appropriate classes.

First problem: _QueryOptions and _SessionHeader were not generated. I worked around this by swiping them from the sample project, since they should be the same for all customers.

Second problem: when I compile, I get the following errors:

AccessSforce1.java:182: cannot resolve symbol
symbol : method setHeader (java.lang.String,java.lang.String,com.sforce.soap.enterprise._SessionHeader)
AccessSforce1.java:469: cannot resolve symbol
symbol : method setHeader (java.lang.String,java.lang.String,com.sforce.soap.enterprise._QueryOptions)

The first error is at this part of my application source code, which is verbatim from the example code:

//Create a new session header object and set the session id to that returned by the login
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(loginResult.getSessionId());
binding.setHeader("SforceService", "SessionHeader", sh);

The second error is also an invocation of binding.setHeader:

_QueryOptions qo = new _QueryOptions();
qo.setBatchSize(new Integer(3));
binding.setHeader("SoapService", "QueryOptions", qo);

It seems from the code that setHeader() is supposed to be a method in SforceServiceLocator, or its superclass org.apache.axis.client.Service. But there's no such method.

I'm running Java 1.4.2 and I have Axis 1.1.

How do I get this to work? Is there an implementation for setHeader() (and presumably getHeader() available)?

DJH
  • July 03, 2004
  • Like
  • 0