10-15-2008 03:18 PM
10-20-2008 04:11 PM
10-20-2008 06:06 PM
10-20-2008 06:29 PM
<Assertion AssertionID="bcb9d36e8f7b5927383d6480e860591b" IssueInstant="2008-10-21T01:15:21.778Z" Issuer="LiveCycle" MajorVersion="1" MinorVersion="1" xmlns="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"><Conditions NotBefore="2008-10-21T01:14:21.778Z" NotOnOrAfter="2008-10-21T03:15:21.778Z"/><AuthenticationStatement AuthenticationInstant="2008-10-21T01:14:21.778Z" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified"><Subject><NameIdentifier NameQualifier="DefaultDom">administrator</NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</ConfirmationMethod></SubjectConfirmation></Subject></AuthenticationStatement><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#'/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1'/><ds:Reference URI="#bcb9d36e8f7b5927383d6480e860591b"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature'/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="code ds kind rw saml samlp typens #default" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#'/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1'/><ds:DigestValue>Zy80NEdSWpbhXsDJ3gHu+8OjZPs=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Eb19gJR41JutgzNK/uddJtq5Jho=</ds:SignatureValue></ds:Signature></Assertion>
Thanks,10-21-2008 04:24 AM
12-17-2009 01:20 PM
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import sun.misc.BASE64Encoder;
import eu.medsea.mimeutil.MimeType;
import eu.medsea.mimeutil.MimeUtil;
import eu.medsea.mimeutil.MimeUtil2;
long start = System.currentTimeMillis();
String host = "localhost";
int port = 8080;
String username = "admin";
String password = "password";
String parentFolder = "Company Home";
String filePath = "c:\\a.pdf";
String description = "PDF upload test";
String author = "administrator";
String ticket = "TICKET_773a26b26495056255dbf1c983cff2401f5a76b5";
String url = "http://" + host + ":" + port + "/alfresco/upload/workspace/SpacesStore/big.pdf";
String contentType = "application/atom+xml;type=entry";
DefaultHttpClient httpclient = new DefaultHttpClient();
//NOT NEEDED BTW
httpclient.getCredentialsProvider().setCredentials(
new AuthScope(host, port),
new UsernamePasswordCredentials(username, password));
HttpPut httppost = null;
try {
httppost = new HttpPut(url);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//TICKET HEADER
httppost.addHeader("ticket", ticket);
System.out.println("executing request" + httppost.getRequestLine());
HttpResponse response = null;
try {
response = httpclient.execute(httppost);
} catch (HttpException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HttpEntity entity = response.getEntity();
System.out.println("—————————————-");
System.out.println(response.getStatusLine());
if (entity != null) {
System.out.println("Response content type: " + entity.getContentType());
long contentLength = entity.getContentLength();
System.out.println("Response content length: "
+ entity.getContentLength());
if (contentLength > 0) {
byte [] b = new byte[(int) contentLength];
try {
entity.getContent().read(b);
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Response content: " + new String(b));
}
try {
entity.writeTo(System.out);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown();
long end = System.currentTimeMillis();
System.out.println("Time spend: " + (end-start) + "ms");
}
12-17-2009 07:30 PM
12-18-2009 12:55 PM
12-20-2009 09:03 AM
// see if a ticket or a force Guest parameter has been supplied
String ticket = req.getParameter(ARG_TICKET);
12-21-2009 10:29 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.