Thanks  Beth.

I placed my files in " http://myServer.edu:8080/FedoraHOME/myManagement/upload/". So I use " http://myServer.edu:8080/fedora/myManagement/upload/myFile.pdf" as the data_url. But I got the error :

--------------------------------------------------------------------------------------------------------------------------------------
fedora.server.errors.authorization.AuthzDeniedException:
AxisFault
 faultCode: {http://www.w3.org/2003/05/soap-envelope}Uncaught
 faultSubcode:
 faultString: java.lang.NullPointerException:null
 faultActor: http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver
 faultNode:
 faultDetail:
    {http://xml.apache.org/axis/}hostname:myServer.edu

java.lang.NullPointerException:null
    at org.apache.axis.message.SOAPFaultBuilder.createFault (SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
--------------------------------------------------------------------------------------------------------------------------------------

and if I throw AuthzDeniedException I don't get any message but the datastream cannot be added

I use the Call to dynamic create objects then add datastream to the object. The creation of object works well if I don't call the addDatastream. But if I call the addDatastream function (to add the pdf to /datastream) then the creation of object sometimes doesn't work. Do you have any idea what did  I do wrong? Any suggestion would be helpful. Thanks

On 7/27/06, Beth Kirschner < bkirschn@umich.edu> wrote:
You need to have a web server somewhere (probably where your client application runs), and you can place your file there. A valid data_url, for example, might be: http://some.server.edu/fedoraUploads/myfile.pdf

- Beth

On Jul 26, 2006, at 1:53 AM, Mary M wrote:

Dear Beth,

Can you tell me how to define the "data_url, // dsLocation"? I have my files in "/fedoraHOME/myManagement/upload/myfile.pdf", how do I set the value in data_url?

Many thanks

Regards

Mary

On 7/18/06, Beth Kirschner < bkirschn@umich.edu> wrote:
Mary,

    Here's an example that uses Apache's axis classes, instead of the
FedoraAPIM class. Hope this helps!

- Beth

--- snip --- snip --- snip --- snip --- snip --- snip --- snip ---
snip --- snip ---

import org.apache.axis.client.Service;
import org.apache.axis.client.Call ;

      try
      {
         Service service = new Service();
         Call call = (Call) service.createCall();
         call.setOperationName(new QName
(FedoraConstants.FEDORA_API_URI, "addDatastream") );
         call.setTargetEndpointAddress( new URL(fedoraManageEndpoint) );
         call.setUsername(fedoraUsername);
         call.setPassword(fedoraPassword);

         call.invoke( new Object[] { pid, // pid
                                     ds_name, // dsId
                                     new String[] {}, // altIds (none)
                                     ds_name,// dsLabel
                                     fedoraVersions, // versionable
                                     mimeType, // MIMEtype
                                     "", // formatURI (none)
                                     data_url, // dsLocation
                                     "E", // controlGr! oup
                                     "A", // dsState (active)
                                     "initial creation" } ); //
logMessage
      }
      catch ( Exception e )
      {
         e.printStackTrace();
         return;
      }