English 中文(简体)
Sugar CRM Integration Using Java and Apache Axis
原标题:

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 fetch 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

最佳回答

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

问题回答

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.





相关问题
Eclipse Generated Web Service Client Extremely Slow

A little up front info: I have a SOAP service (hosted using JAX-WS (Endpoint class), but I don t think that is important). I can connect to and use the web service just fine with Visual Studio ...

Changing the color of an axis

Is there a way to change the color of an axis (not the ticks) in matplotlib? I have been looking through the docs for Axes, Axis, and Artist, but no luck; the matplotlib gallery also has no hint. Any ...

Passing parameters to AXIS web service

I have an AXIS servlet which deployed on an apache tomcat server on windows. I wrote a web service which I want to run on AXIS. When I want to deploy my web service, I make a jar file from the ...

Why does Tomcat error when I change the keystore?

I have a problem with axis2-client inside JAX-WS web service. This JAX-WS web service is inside Tomcat container. Keystorefile is retrieved dynamically from database. When I start Tomcat I can use ws-...

Rotating axis labels in R

How do I make a (bar) plot s y axis labels parallel to the X axis instead of parallel to the Y axis?

In-process SOAP service server for Java

OK, I am developing a program which will be deployed to lots of machines (Windows, Linux, AIX, z/Linux, openVMS, etc.). I want that application to contain a SOAP web service, but I don t want to ...

Buliding a WAR that uses Axis2 + Rampart for Tomcat

I m trying to build an axis-based web service with rampart for security, and I ve been hoping to deploy a single war to tomcat, rather than installing axis and deploying within axis. (I m not fixed ...

Axis 1.4 AxisFault Premature end of file

I get this error when I use my autogenerated ServiceBindingStub.java. WebService side is working ok, so this error must be in code, but code is autogenerated, so I cannot know why it doesn t work. ...

热门标签