开发者

Sugar CRM Integration Using Java and Apache Axis

开发者 https://www.devze.com 2022-12-22 06:07 出处:网络
I\'m trying to integrate Sugar CRM with one of my projects. I\'m using Apache Axis as my SOAP client.

I'm trying to integrate Sugar CRM with one of my projects. I'm using Apache Axis as my SOAP client.

I got the initial setup from this blog. Using this tutorial I'm able to login, fetch and insert data into my Sugar CRM installation.

I'm trying to fetch Leads using the following code

Get_entry_list_result_version2 entryList = port.get_entry_list(
            sessionID, "Leads", "", "", 0, new String[] { "first_name",
                    "phone_work" }, null, 2, 0);

This portion is working fine, but when I try to add a query criteria as the 3rd parameter, system is throwing an error

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode: 
faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
faultActor: 
faultNode: 
faultDetail: 
    {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)

Thank you

here is my new fetc开发者_如何转开发h using the query

Get_entry_list_result_version2 entryList = port.get_entry_list(
            sessionID, "Leads", "first_name='arun'", "", 0, new String[] { "first_name",
                    "phone_work" }, null, 2, 0);

What am I doing wrong?

I've already compiled my axis-1.4 library to fix this bug


Arun P Johny's answer was correct and very helpful. I am using Talend Open Studio w/ tSugarCRMInput component. Even though there is a field for Module, the query does need to be fully qualified.


I figured it out, need to have a query qualified by the module name:

Sorry for my ignorance.

My further searches took me to here.

After fixing my code looks like

Get_entry_list_result_version2 entryList = port.get_entry_list(
            sessionID, "Leads", " leads.last_name ='LastName' ", "", 0, new String[] { "first_name",
                    "phone_work", "sic_code" }, null, 10, 0);

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消