Hi,
we are starting to play with import/export in Centric and we are running immediately in troubles :-)
According to Dark Horse Ventures XML API documentation (version 1.5 Octorber 18, 2004) we have first proceded to server setup:
Created an entry in [sync_client] with the following values:
type: web feeder
version:1
enteredby:0
modifiedby:0
enabled:true
code:---
clientid:2
Coded this little php snipped from your example:
<?PHP
$xmlDocument='<?xml version="1.0" encoding="utf-8"?>
<app>
<authentication>
<id>www.site.com</id>
---
<systemId>2</systemId>
</authentication>
<meta>
<property>id</property>
</meta>
<transaction id="1">
<ticket action="insert">
<problem><![CDATA[this is my first xml-API inserted ticket></problem>]]
<sourceCode>123</sourceCode>
<catCode>1</catCode>
<subCat1>2</subCat1>
<subCat2>3</subCat2>
<subCat3>4</subCat3>
</ticket>
</transaction>
</app>
';
// Site to post to
$server = "www.site.com";
$path = "/centric/ProcessPacket.do";
// Begin the transfer
$socket = fsockopen($server, 8080);
if (!$socket)
//echo" error: could not connect to server";
// return
} else
// Post the XML document
$request = "POST " . $path . " HTTP/1.0\r\n" .
"Host: " . $server . "\r\n" .
"Content-Type: text/xml\r\n" .
"Content-Length: " . strlen($xmlDocument) . "\r\n\r\n" .
$xmlDocument;
if (!fputs($socket, $request, strlen($request)))
//echo"error: could not write to server";
// return
}
$response = ;
while ($data = fread($socket, 32768))
$response .= $data;
}
fclose($socket);
if ($response = )
echo "error: no response from server";
// return
} else
echo "-$response-";
}
}
//echo $xmlDocument;
?>
Running this has no effect and we do not receive any kind of response.. :-(
Looking on tomcat log we found this exception:
java.sql.SQLException: Sync Client record not found.
at org.aspcfs.modules.service.base.SyncClient.<init>(Unknown Source)
at org.aspcfs.modules.service.actions.ProcessPacket.executeCommandDefault(Unknown Source)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.darkhorseventures.framework.servlets.ControllerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
According to documentation Systemid is "an id the server assigned to map the transaction to". We have tested with several values, also our "clientid" that is 2 but nothing.
It's not clear what value has to be used.
Objectname tag is not present in the xml of your example...
Action is "insert".
The exception seems to be about centric not be able to find our client record.
We do not understand if there is a problem with some "id"..
In the xml of the example there is no a tag in the authentication section for the clientid..
We are confused :-) :-)
Thank you
Lucio