Hi Luis
NuSoap is a little old now (from the age of 'Nu Metal' I think *shudders*). If
you were writing anything new, the in-build PHP soap client is pretty good, or
the Zend Framework Zend_Soap_Client isn't bad either.
http://framework.zend.com/manual/en/zend.soap.html
http://www.php.net/manual/en/class.soapclient.php
Either of those more modern will probably make debugging/working with SOAP in
PHP much easier than NuSOAP (and faster too since soap_client is built into
php, therefore is compiled C).
Cheers,
Christiaan
From: Luis Horacio Arizaga
<arizaga.l...@yahoo.com.ar<mailto:arizaga.l...@yahoo.com.ar>>
Reply-To: Luis Horacio Arizaga
<arizaga.l...@yahoo.com.ar<mailto:arizaga.l...@yahoo.com.ar>>, "Support and
info exchange list for Fedora users."
<fedora-commons-users@lists.sourceforge.net<mailto:fedora-commons-users@lists.sourceforge.net>>
Date: Thu, 8 Mar 2012 15:58:25 -0800
To:
"fedora-commons-users@lists.sourceforge.net<mailto:fedora-commons-users@lists.sourceforge.net>"
<fedora-commons-users@lists.sourceforge.net<mailto:fedora-commons-users@lists.sourceforge.net>>
Subject: [fcrepo-user] Ingest problems with PHP, NuSoap and API-M
Hi am doing some tests and trying to create an object in Fedora using PHP,
NuSoap and the API-M. I'm using the "ingest" call but I keep getting this error:
array(3) { ["faultcode"]=> string(28) "soapenv:Server.userException"
["faultstring"]=> string(104) "org.xml.sax.SAXParseException: The processing
instruction target matching "[xX][mM][lL]" is not allowed." ["detail"]=>
array(1) { ["hostname"]=> string(6) "ubuntu" } }
I am just using an object provided in the demo and triming the string as in
some forums people say this error is dued to white spaces before the chain of
caracters. My code is the one that follows:
$string_xml = '<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject PID="demo:18" VERSION="1.1"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="info:fedora/fedora-system:def/foxml#
http://www.fedora.info/definitions/1/0/foxml1-1.xsd"><foxml:objectProperties><foxml:property
NAME="info:fedora/fedora-system:def/model#state"
VALUE="Active"/><foxml:property
NAME="info:fedora/fedora-system:def/model#label" VALUE="Data Object (ECDL
Paper) for Simple Document Demo"/><foxml:property
NAME="info:fedora/fedora-system:def/model#ownerId"
VALUE="fedoraAdmin"/><foxml:property
NAME="info:fedora/fedora-system:def/model#createdDate"
VALUE="2008-07-02T05:09:42.015Z"/><foxml:property
NAME="info:fedora/fedora-system:def/view#lastModifiedDate"
VALUE="2008-07-02T05:09:42.015Z"/></foxml:objectProperties><foxml:datastream
CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true"><foxml:datastreamVersion
CREATED="2008-07-02T05:09:43.312Z"
FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" ID="DC1.0"
LABEL="Dublin Core Record for this object"
MIMETYPE="text/xml"><foxml:xmlContent><oai_dc:dc
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"><dc:title>The Mellon
Fedora Project: Digital Library Architecture Meets XML and Web
Services</dc:title><dc:creator>Sandra Payette</dc:creator><dc:creator>Thornton
Staples</dc:creator><dc:subject>Fedora</dc:subject><dc:subject>repository
architecture</dc:subject><dc:subject>digital
libraries</dc:subject><dc:subject>web service</dc:subject><dc:subject>open
source software</dc:subject><dc:description>Paper on the Fedora project,
presented at the European Digital Library Conference (ECDL) in 2002, Rome,
Italy</dc:description><dc:publisher>Springer</dc:publisher><dc:date>2002-09-17</dc:date><dc:format>application/pdf</dc:format><dc:format>application/msword</dc:format><dc:format>application/ps</dc:format><dc:identifier>demo:18</dc:identifier><dc:relation>http://www.fedora.info</dc:relation><dc:rights>unrestricted</dc:rights></oai_dc:dc></foxml:xmlContent></foxml:datastreamVersion></foxml:datastream><foxml:datastream
CONTROL_GROUP="E" ID="DS1" STATE="A"
VERSIONABLE="true"><foxml:datastreamVersion CREATED="2008-07-02T05:09:43.312Z"
ID="DS1.0" LABEL="The Mellon Fedora Project: Digital Library Architecture Meets
XML and Web Services (Formatted in MSWord)"
MIMETYPE="application/msword"><foxml:contentLocation
REF="http://local.fedora.server/fedora-demo/simple-document-demo/ecdl2002pay.doc"
TYPE="INTERNAL_ID"/></foxml:datastreamVersion></foxml:datastream><foxml:datastream
CONTROL_GROUP="E" ID="DS2" STATE="A"
VERSIONABLE="true"><foxml:datastreamVersion CREATED="2008-07-02T05:09:43.312Z"
ID="DS2.0" LABEL="The Mellon Fedora Project: Digital Library Architecture Meets
XML and Web Services (Formatted in PDF)"
MIMETYPE="application/pdf"><foxml:contentLocation
REF="http://local.fedora.server/fedora-demo/simple-document-demo/ecdl2002pay.pdf"
TYPE="INTERNAL_ID"/></foxml:datastreamVersion></foxml:datastream><foxml:datastream
CONTROL_GROUP="E" ID="DS3" STATE="A"
VERSIONABLE="true"><foxml:datastreamVersion CREATED="2008-07-02T05:09:43.312Z"
ID="DS3.0" LABEL="The Mellon Fedora Project: Digital Library Architecture Meets
XML and Web Services (Formatted in PS)"
MIMETYPE="application/ps"><foxml:contentLocation
REF="http://local.fedora.server/fedora-demo/simple-document-demo/ecdl2002pay.ps"
TYPE="INTERNAL_ID"/></foxml:datastreamVersion></foxml:datastream></foxml:digitalObject>';
$servicio = new
nusoap_client("http://localhost:8080/fedora/wsdl?api=API-M", true);
$err = $servicio->getError();
echo $err;
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
/// At this point, you know the call that follows will fail
}
$servicio->setCredentials('fedoraAdmin','fedoraAdmin','basic',
array('passphrase'));
$string_xml = trim($string_xml);
$respuesta = $servicio->call('ingest', array('objectXML' =>
$string_xml,'format' => 'info:fedora/fedora-system:FOXML-1.1', 'logMessage' =>
'Se ha creado un objeto'));
if ($servicio->fault){
print_r($objeto);
}
var_dump($respuesta);
Could somebody please tell me what I am doing wrong? I'm a noobio in web
services lol Any help will be appreciated. Thanks in advance.
Luis Horacio Arizaga
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning Cloud computing makes
use of virtualization - but cloud computing also focuses on allowing computing
to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users@lists.sourceforge.net<mailto:Fedora-commons-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users