• ndoshi
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies

Is the regex that is used for email field format validationin salesforce publicly available somewhere?

I have seen regex string that vary from as few as a few characters to a page long.

I would like to use the same one that salesforce uses to avoid any disconnect.

  • August 18, 2009
  • Like
  • 0
I am getting the following exception when I try logging into the API :

java.lang.LinkageError: loader constraints violated when linking javax/xml/soap/SOAPMessage class
        at org.apache.axis.AxisFault.setFaultCodeAsString(AxisFault.java:422)
        at org.apache.axis.AxisFault.<init>(AxisFault.java:228)
        at com.sforce.soap.enterprise.SoapBindingStub.createCall(SoapBindingStub.java:2992)
        at com.sforce.soap.enterprise.SoapBindingStub.login(SoapBindingStub.java:3000)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.login(SalesforceSessionManager.java:104)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.checkLogin(SalesforceSessionManager.java:138
)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.executeQuery(SalesforceSessionManager.java:2
27)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.executeSOQL(SalesforceSessionManager.java:26
4)


This only happens when I re-deploy the axis2, which the web service runs in.
Restarting JBoss resolves the problem.


Does anyone have any ideas?
  • November 19, 2008
  • Like
  • 0
I have an internal web service that I am invoking from an apex callout.
It currently works fine, but before we go into production I want to implement some security.
I am looking for a way to authenticate that the request is actually coming from salesforce and if possible, coming from a user in our org.

Any suggestions on how to do this?

Thanks!

--Neil

ps: If there are any prior posts or existing documentation, please point me to them.
  • November 19, 2008
  • Like
  • 0
I am getting the following exception when I try logging into the API :

java.lang.LinkageError: loader constraints violated when linking javax/xml/soap/SOAPMessage class
        at org.apache.axis.AxisFault.setFaultCodeAsString(AxisFault.java:422)
        at org.apache.axis.AxisFault.<init>(AxisFault.java:228)
        at com.sforce.soap.enterprise.SoapBindingStub.createCall(SoapBindingStub.java:2992)
        at com.sforce.soap.enterprise.SoapBindingStub.login(SoapBindingStub.java:3000)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.login(SalesforceSessionManager.java:104)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.checkLogin(SalesforceSessionManager.java:138
)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.executeQuery(SalesforceSessionManager.java:2
27)
        at com.odc.salesforceservice.salesforceapi.SalesforceSessionManager.executeSOQL(SalesforceSessionManager.java:26
4)


This only happens when I re-deploy the axis2, which the web service runs in.
Restarting JBoss resolves the problem.


Does anyone have any ideas?
  • November 19, 2008
  • Like
  • 0
I have an internal web service that I am invoking from an apex callout.
It currently works fine, but before we go into production I want to implement some security.
I am looking for a way to authenticate that the request is actually coming from salesforce and if possible, coming from a user in our org.

Any suggestions on how to do this?

Thanks!

--Neil

ps: If there are any prior posts or existing documentation, please point me to them.
  • November 19, 2008
  • Like
  • 0
I recently encountered a scenario where I was able to develop and unit test without issue a controller class containing internal classes. During the deployment process using the IDE, the validation process also Succeeded; however, when I hit the finish button the deployment failed with the following error: 'Dependent class is invalid and needs recompilation ...[reference to test method and code line]... The configuration of your org has changed, please reload the page. Missing dependent object [reference to original class and subclass object]'

I was able to successfully deploy this class when i moved the internal class definitions to the code block instead of the end, but I'm confused as to whether this worked because internal classes must be declared before all other class methods and properties (and if so why it successfully saved to the sandbox environment in the first place) or whether this worked because it somehow forced the recompilation/page reload  alluded to in the error message.

I know it's not an urgent issue but could someone provide some insight as to what's going on so I can better develop similar classes in the future?

  • November 12, 2008
  • Like
  • 0
Hi,

Im trying to resolve a problem Im having with Attachments. I have no problem uploading them using the API after a conversionform .txt file to a Base64 byte array but when I try to retrieve them from the SF database using  "Save as..." through the website, the file which is retrieved is still in the base64 format.

This is the conversion code I am using, which I believe may be the cause of the problem

Sample code:

            FileStream fs = new FileStream(@fileName,FileMode.Open,FileAccess.Read);
            byte[] filebytes = new byte[fs.Length];
            fs.Read(filebytes, 0, Convert.ToInt32(fs.Length));
            string encodedData = Convert.ToBase64String(filebytes,Base64FormattingOptions.InsertLineBreaks);

            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            filebytes = encoding.GetBytes(encodedData);

            //Create an attachment object to send to the license
            sforce.Attachment to_attach = new sforce.Attachment();

            //Set several properties
            to_attach.Name = fileName;
            to_attach.Body = filebytes;


I have also tried adding the MIME dat a to the string for conversion  like so:

string encodedData = si:type=\"xsd:base64Binary\">" +  Convert.ToBase64String(filebytes,Base64FormattingOptions.InsertLineBreaks);

but with no sucess????

Can anyone spot any errors or give som advice???

Thanks
Hi all.

I need create SoapBindingStub object w/o calling

LoginResult lr = binding.login(userName, password);

I need to avoid the 'full scenario':

SoapBindingStub binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
LoginResult lr = binding.login(userName, password);
binding = (SoapBindingStub) new SforceServiceLocator().getSoap(new URL(lr.getServerUrl()));
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(lr.getSessionId());
binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);


The main idea is:
I want to recieve session ID value from the web-link then I want to create correct/working SoapBindingStub object WITHOUT invocation binding.login(userName, password) method.

is is possible to do? How is better accomplish it?

Now I'm trying something like that:

SforceServiceLocator locator = new SforceServiceLocator();
System.out.println("----- service URL is = " + locator.getSoapAddress()); // URL is correct !
binding = (SoapBindingStub) locator.getSoap();

// I can try to make a dummy call but it doesn't help
// binding.describeGlobal();

_SessionHeader sh = new _SessionHeader();
sh.setSessionId(sessionId);
binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);

I'm getting error (on the dummy binding.describeGlobal() or on the real subseqWS call):

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Destination URL not reset. The URL returned from login must be set in the SforceService
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}fault: UNKNOWN_EXCEPTIONtionCode> Destination URL not reset. The URL returned from login must be set in the SforceService
Destination URL not reset. The URL returned from login must be set in th
e SforceService