You need to sign in to do that
Don't have an account?
Trouble logging in via WSC connection
I'm having trouble logging into Salesforce via the wsc-22.jar as documented here:
https://wiki.apexdevnet.com/page/Introduction_to_the_Force.com_Web_Services_Connector
My code:
String stoken = "<valid token>";
ConnectorConfig config = new ConnectorConfig
config.setUsername("<valid username>")
config.setPassword("<valid password>" + stoken)
println("Username: " + config.getUsername + ", Password: " + config.getPassword())
config.setTraceMessage(true)
Connection connection = Connector.newConnection(config)
My results:
Username: <valid username>, Password: <valid password><valid token>
WSC: Creating a new connection to https://www.salesforce.com/services/Soap/u/18.0 Proxy = DIRECT username null
------------ Request start ----------
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><m:login xmlns:m="urn:partner.soap.sforce.com" xmlns:sobj="urn:sobject.partner.soap.sforce.com"><m:username>valid username</m:username><m:password>valid password + token</m:password></m:login></env:Body></env:Envelope>
------------ Request end ----------
null=[HTTP/1.1 500 Internal Server Error]
Date=[Tue, 22 Nov 2011 16:53:48 GMT]
Content-Length=[336]
Content-Encoding=[gzip]
Content-Type=[text/xml; charset=UTF-8]
Server=[]
------------ Response start ----------
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>INVALID_LOGIN</faultcode><faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring><detail><sf:LoginFault xsi:type="sf:LoginFault"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage></sf:LoginFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
------------ Response end ----------
Exception in thread "main" [LoginFault [ApiFault exceptionCode='INVALID_LOGIN'
exceptionMessage='Invalid username, password, security token; or user locked out.'
]
]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:627)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:504)
at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:229)
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:203)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98)
at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:818)
at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.java:315)
at com.sforce.soap.partner.Connector.newConnection(Connector.java:27)
at salesforce.SalesforceUser.authenticate(SalesforceUser.scala:19)
at salesforce.SalesforceUser$delayedInit$body.apply(SalesforceUser.scala:46)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:60)
at scala.App$$anonfun$main$1.apply(App.scala:60)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
at scala.App$class.main(App.scala:60)
at salesforce.SalesforceUser$.main(SalesforceUser.scala:41)
at salesforce.SalesforceUser.main(SalesforceUser.scala)
All my user info looks good and my account is not locked. The username I'm using is the email I setup for web login.
Any help is appreciated!
Vince
use new security token. and then try