• vmarco
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies

I need to assign a profile to a user using the Java WSC API.  Currently I use:

sobj.setField("ProfileId", parent.getProfileId);

However, I need to set the profile to a specific Profile.  I assume this means looking up that profile (ie. "Standard User").  However, I cannot quite get this to work.

 

Any help?

 

Vince

 

I have implemented and configured delegated SSO.  My browser POST is sending to salesforce which then after the 10 second timeout says it cannot contact my service.

 

This service is implemented as a servlet handling the SOAP request and returning a SOAP response.  Is there some handshake that requries the wsdl that is normally deployed on a SOAP service.  I ran into troubles surfacing a JAX-WS SOAP endpoint in my service environment, but did get the servlet endpoint responding and working great.

 

I test this with the same URL in the Gateway URL configuration via curl.  Is there some way to see the URL that is actually sent by salesforce?

 

Thanks,

 

Vince

 

  • March 14, 2012
  • Like
  • 0

I'm trying to create a service which eases employee onboarding.  As such my service needs to be able to create users on the corporate SF account.  I'm down to errors on the picklist fields: TimeZoneSidKey, LocaleSidKey, EmailEncodingKey, ProfileId, and LanguageLocalKey.

 

My question is how do I get these picklists?  Are there some standard queries for those?

 

Thanks,

 

Vince

 

  • January 25, 2012
  • Like
  • 0

I am using the partner WSC-22 library to create a SF user on my DE account from a service.  Everything runs smoothly (ie. no exceptions), however the user does not show up in my user management list of users.  No error, no results.  Any suggestions?  Code is in Scala.  I have had exceptions when improperly submitting fields, so I know it is reaching SF.

 

doLogin()
val sobj = new SObject
sobj.setType("User")
sobj.setField("LastName", users(0))
sobj.setField("Alias", users(0))
sobj.setField("Email", email)
sobj.setField("Username", users(0))
val result = _connection.create(Array(sobj))

  • January 25, 2012
  • Like
  • 0

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

  • November 23, 2011
  • Like
  • 0

I'm trying to create a service which eases employee onboarding.  As such my service needs to be able to create users on the corporate SF account.  I'm down to errors on the picklist fields: TimeZoneSidKey, LocaleSidKey, EmailEncodingKey, ProfileId, and LanguageLocalKey.

 

My question is how do I get these picklists?  Are there some standard queries for those?

 

Thanks,

 

Vince

 

  • January 25, 2012
  • Like
  • 0

I am using the partner WSC-22 library to create a SF user on my DE account from a service.  Everything runs smoothly (ie. no exceptions), however the user does not show up in my user management list of users.  No error, no results.  Any suggestions?  Code is in Scala.  I have had exceptions when improperly submitting fields, so I know it is reaching SF.

 

doLogin()
val sobj = new SObject
sobj.setType("User")
sobj.setField("LastName", users(0))
sobj.setField("Alias", users(0))
sobj.setField("Email", email)
sobj.setField("Username", users(0))
val result = _connection.create(Array(sobj))

  • January 25, 2012
  • Like
  • 0