• Cdub
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
I'm able to read text files fine. But this is a windows media file type and the stream only returns the download page.
  • July 24, 2014
  • Like
  • 0
Hi,

While connecting to following URL - https://test.salesforce.com/services/Soap/u/30.0 from Datastage using TLS 1.2 we are getting below error -

nested exception is: 
    org.xml.sax.SAXException: Invalid element in com.sforce.soap.partner.fault.UnexpectedErrorFault - upgradeURL

Using TLS 1.0 same url works fine.
We generated new WSDL and now tried connecting to - https://test.salesforce.com/services/Soap/u/39.0 and now its not even log in succesfully, getting below error -

Invalid username, password, security token; or user locked out.</ns1:exceptionMessage>
INVALID_LOGIN: Invalid username, password, security token; or user locked out.

I tried using the web browser and its working fine, not sure whats causing this.
A change they made in June to prevent TLS1.0 communication is causing an error with an add on app we are testing. We are trying to correct this in the API call. We made change the java program as per the instructions from Salesfroce.com but continue to get the same error. The api call works against the development org but gives error when pointed to sandbox environment.


INFO 1110 134339.484 Processor0 Calling GmlProcessorExternalData query ERROR 1110 134339.839 Processor0 DX Server:https.protocols is TLSv1.1,TLSv1.2 INFO 1110 134339.839 Processor0 DX Server:Logging into salesforce [ User ID : gloviasf@ii-vi.com.apr2013 Password Marlowsf5mRJosnVKDRHve2zU9ZjwBHD1Q] Client ID : Glovia ERROR 1110 134343.781 Processor0 DX Server:Salesforce Login Failure : Error passed from Salesforce.com = ; nested exception is: org.xml.sax.SAXException: Invalid element in com.sforce.soap.partner.fault.UnexpectedErrorFault - upgradeURL Credentials : [[ User ID : gloviasf@ii-vi.com.apr2013 Password Marlowsf5mRJosnVKDRHve2zU9ZjwBHD1Q]] ERROR 1110 134343.784 Processor0 com.glovia.common.util.DataSyncProvider$SyncException: Salesforce Login Failure : Error passed from Salesforce.com = ; nested exception is: org.xml.sax.SAXException: Invalid element in com.sforce.soap.partner.fault.UnexpectedErrorFault - upgradeURL Credentials : [[ User ID : gloviasf@ii-vi.com.apr2013 Password Marlowsf5mRJosnVKDRHve2zU9ZjwBHD1Q]] at com.glovia.sync.salesforce.SalesforceConnection.login(SalesforceConnection.java:192) at com.glovia.sync.salesforce.Session.setup(Session.java:83) at com.glovia.sync.salesforce.Session.query(Session.java:115) at com.glovia.sync.salesforce.SalesforceSync.query(SalesforceSync.java:73) at com.glovia.eaccess.gml.GmlProcessorExternalData.process(GmlProcessorExternalData.java:166) at com.glovia.eaccess.gml.GmlArray.process(GmlArray.java:44) at com.glovia.eaccess.gml.GmlProcessorEntity.processChildrenEx(GmlProcessorEntity.java:178) at com.glovia.eaccess.gml.GmlProcessorTop.process(GmlProcessorTop.java:22) at com.glovia.eaccess.gml.GmlEngine.process(GmlEngine.java:302) at com.glovia.eaccess.gml.GmlEngine.parseAndProcessURL(GmlEngine.java:246) at com.glovia.eaccess.gml.GmlEngine.processAlternateUrl(GmlEngine.java:144) at com.glovia.eaccess.gml.GmlProcessorInclude.process(GmlProcessorInclude.java:79) at com.glovia.eaccess.gml.GmlArray.process(GmlArray.java:44) at com.glovia.eaccess.gml.GmlProcessorEntity.processChildrenEx(GmlProcessorEntity.java:178) at com.glovia.eaccess.gml.GmlProcessorTop.process(GmlProcessorTop.java:22) at com.glovia.eaccess.gml.GmlEngine.process(GmlEngine.java:302) at com.glovia.eaccess.gml.GmlEngine.parseAndProcessURL(GmlEngine.java:246) at com.glovia.eaccess.gml.GmlEngine.processLicensing(GmlEngine.java:320) at com.glovia.eaccess.gml.GmlEngine.process(GmlEngine.java:114) at com.glovia.eaccess.dxserver.DXRequestImpl.processGML(DXRequestImpl.java:375) at com.glovia.eaccess.dxserver.DXRequestImpl.process(DXRequestImpl.java:337) at com.glovia.eaccess.dxserver.DXRequestImpl.run(DXRequestImpl.java:226) at com.glovia.eaccess.dxserver.DXRequestThread.run(DXRequestThread.java:34) INFO 1110 134343.788 Processor0 Error: Salesforce Login Failure : Error passed from Salesforce.com = ; nested exception is: org.xml.sax.SAXException: Invalid element in com.sforce.soap.partner.fault.UnexpectedErrorFault - upgradeURL Credentials : [[ User ID : gloviasf@ii-vi.com.apr2013 Password Marlowsf5mRJosnVKDRHve2zU9ZjwBHD1Q]]
  • November 15, 2016
  • Like
  • 0
Hi, 
I am setting up a Knowledge Base and I want to use a custom Search page build with Visual Force. I copied the exact code from: http://www.salesforce.com/docs/developer/knowledge_devpre/Content/knowledge_customize_searchpage_visualforce_04searchfilter.htm
Then I changed the line categoryCondition = 'Fashions:All,Stores:All,Products:All' ; into categoryCondition = 'Knowledge_Base:All'  in the file
VfSearchController.

I only have one Data Category Group named: Knowledge_Base
My Data Category Structure looks like this:
- Test1
- Test2
- - Test3 (= child of Test2)
- - Test4 (= child of Test2)

When I logon as Admin the filter displays the above list correctly (All, No Filter, Test1, etc...)
But when I create a user and give him only rights to access Test1 and Test3 I get the error message: "<knowledge:categoryList> unknown category: All

How do I have to modify my code to get a Category Filter list look like this:
- No Filter
- Test1
- Test3

When I login as that user and use the standard Knowledge Search, all works well and I get the above filter list.

Please help!
I have C# batch which communicate with salesforce objects via SOAP API.
I want to fetch an image which is part of the Rich Text Field in salesforce custom object.
The rich text field himself is Html text and I can get the url of the image tag, but the problem is that the url himself is Https = Http secure connection:
The url of the image tag:

 https://ngam--kerensen.cs17.my.salesforce.com?ec=302&startURL=%2Fcontent%2Fsession%3Furl%3Dhttps%253A%252F%252Fngam--kerensen--c.cs17.content.force.com%252Fservlet%252FrtaImage%253Feid%253Da1Vg0000000lTkK%2526feoid%253D00N20000003jcie%2526refid%253D0EMg00000009N4I (http://ngam--kerensen.cs17.my.salesforce.com?ec=302&startURL=%2Fcontent%2Fsession%3Furl%3Dhttps%253A%252F%252Fngam--kerensen--c.cs17.content.force.com%252Fservlet%252FrtaImage%253Feid%253Da1Vg0000000lTkK%2526feoid%253D00N20000003jcie%2526refid%253D0EMg00000009N4I)

As a result of this, I can't get the resource and write it to a file as a local image for later use.
This is the C# code for fetching the image:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    bool answer = response.ContentType.StartsWith("image", StringComparison.OrdinalIgnoreCase);
     if ((response.StatusCode == HttpStatusCode.OK ||
                        response.StatusCode == HttpStatusCode.Moved ||
                        response.StatusCode == HttpStatusCode.Redirect)&&
                        response.ContentType.StartsWith("text/html", StringComparison.OrdinalIgnoreCase)){
       // if the remote file was found, download it
         using (Stream inputStream = response.GetResponseStream())
         using (Stream outputStream = File.OpenWrite(filepath))
                        {
                            byte[] buffer = new byte[8192];
                            int bytesRead;
   
                            logger.InfoFormat("Writing to file, filepath:{0}", filepath);
                            do
                            {
                                bytesRead = inputStream.Read(buffer, 0, buffer.Length);
                                logger.InfoFormat("bytesRead: {0} ", bytesRead);
                                outputStream.Write(buffer, 0, bytesRead);
                            } while (bytesRead != 0);
                            //TODO outputStream.Close();
   
                        }
                        return true;
   
                    }
                }
                catch (Exception ex)
                {
                    logger.ErrorFormat("Failed to download {0} to {1} : {2}",
                        uri, filepath, ex.Message);
                    logger.Debug("Failed to download " + uri, ex);
                }
   
                return false;



I know that the secure url using java servlet for exposing the image to the world.
The problem is that I can't get the image data and always get the following respond:

    
<script>
    if (this.SfdcApp && this.SfdcApp.projectOneNavigator) { SfdcApp.projectOneNavigator.handleRedirect('https://ngam--kerensen.cs17.my.salesforce.com?ec=302&startURL=%2Fcontent%2Fsession%3Furl%3Dhttps%253A%252F%252Fngam--kerensen--c.cs17.content.force.com%252Fservlet%252FrtaImage%253Feid%253Da1Vg0000000lTkK%2526feoid%253D00N20000003jcie%2526refid%253D0EMg00000009N4I'); }  else
    if (window.location.replace){
    window.location.replace('https://ngam--kerensen.cs17.my.salesforce.com?ec=302&startURL=%2Fcontent%2Fsession%3Furl%3Dhttps%253A%252F%252Fngam--kerensen--c.cs17.content.force.com%252Fservlet%252FrtaImage%253Feid%253Da1Vg0000000lTkK%2526feoid%253D00N20000003jcie%2526refid%253D0EMg00000009N4I');
    } else {;
    window.location.href ='https://ngam--kerensen.cs17.my.salesforce.com?ec=302&startURL=%2Fcontent%2Fsession%3Furl%3Dhttps%253A%252F%252Fngam--kerensen--c.cs17.content.force.com%252Fservlet%252FrtaImage%253Feid%253Da1Vg0000000lTkK%2526feoid%253D00N20000003jcie%2526refid%253D0EMg00000009N4I';
    }
    </script>



Any suggestion how to get the actual image data from the Rich Text Area field?