Hey all,
I'm trying to ingest an object with PHP (5.3.1) through the NuSOAP
library (0.7.3), but I'm receiving an authorization error, although
I'm sure the username and pass are set correctly. Does anyone have any
familiarity with this ingest approach? I'm using Fedora 3.3. Here is
the PHP code, and the output:
<?php
$file = 'hwXML/1012.xml';
$logmsg = 'Fedora Object ingested from php web form';
require_once('nusoap/lib/nusoap.php');
$mclient = new nusoap_client('http://12.3.4.5:8080/fedora/wsdl?api=API-M',
'wsdl', '12.3.4.5', '8080', 'fedoraAdmin', 'fedoraAdmin');
$parms=array('objectXML' => 'hwXML/1012.xml', 'format' => 'foxml1.1',
'logMessage' => $logmsg);
$response = $mclient->call('ingest', $parms);
if ($mclient->fault) {
$returnstring = "error=ERROR: <i>".$mclient->faultstring."</i>";
echo "err=".$mclient->faultstring."<br/> \n".$mclient->faultcode;
} else {
echo "ok=true&keys=".$returnstring;
}
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($mclient->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($mclient->response, ENT_QUOTES) . '</pre>';
?>
And this is the output:
ok=true&keys=
Request
POST http://12.3.4.5:8080/fedora/services/management HTTP/1.0
Host: 12.3.4.5:8080
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: "http://www.fedora.info/definitions/1/0/api/#ingest"
Proxy-Authorization: Basic ZmVkb3JhQWRtaW46ZmVkb3JhQWRtaW4=
Content-Length: 544
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns5518="http://tempuri.org"><SOAP-ENV:Body><ingest
xmlns=""><objectXML xmlns="">hwXML/1012.xml</objectXML><format
xmlns="">foxml1.1</format><logMessage xmlns="">Fedora Object ingested
from php web form</logMessage></ingest></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response
HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: BASIC realm="fedora"
Set-Cookie: JSESSIONID=FCF342F5CFD3B9D136682AADF3292E7B; Path=/fedora
WWW-Authenticate: BASIC realm="Fedora Repository Server"
Content-Type: text/html;charset=UTF8
Date: Fri, 16 Apr 2010 23:18:49 GMT
Connection: close
<html><head>
<title>Fedora: 401 Unauthorized</title></head>
<body>
<center>
<table border="0" cellpadding="0" cellspacing="0" width="784">
<tbody><tr>
<td height="134" valign="top" width="141"><img
src="/fedora/images/newlogo2.jpg" height="134" width="141"></td>
<td valign="top" width="643">
<center>
<h2>401 Unauthorized</h2>
<h3>Authentication failed</h3>
</center>
</td>
</tr>
</tbody></table>
</center>
</body></html>
I just picked NuSOAP because it came up as a simple SOAP class for
PHP, but really any method in PHP to simply ingest a FOXML to the
repository would be fine for my purposes.
Any help appreciated-
Thanks,
W
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users