Use Amazon SDK Client (https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip) and following Java code:
String accessKey = "1";
String secretKey = "2";
String endpoint = "http://localhost:8080";
String bucket = "UPPERCASE";
SignerFactory.registerSigner("S3SignerType", S3Signer.class);
BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setSignerOverride("S3SignerType");
clientConfig.setProtocol(Protocol.HTTP);
AmazonS3Client conn = new AmazonS3Client(credentials, clientConfig);
conn.setEndpoint(endpoint);
InMemoryRegionImpl region = new InMemoryRegionImpl("ceph", "localhost");
region.addEndpoint("s3", endpoint);
conn.setRegion(new com.amazonaws.regions.Region(region));
System.out.println(conn.listBuckets().get(0));
byte[] bytes = "Hello World!".getBytes();
ByteArrayInputStream input = new ByteArrayInputStream(bytes);
try {
ObjectMetadata md = new ObjectMetadata();
md.setContentLength(bytes.length);
md.setHeader("x-amz-acl", "public-read");
PutObjectRequest por = new PutObjectRequest(bucket, "plik.txt", input, md);
PutObjectResult res = conn.putObject(por);
System.out.println(res);
}
catch (AmazonS3Exception s3e) {
s3e.printStackTrace();
}
wtorek, lipca 12, 2016
sobota, lipca 09, 2016
piątek, lipca 08, 2016
Tibco BW and SalesForce
You can access SalesForce integration API without dedicated adapter, just modify SF WSDL file:
<complexType name="sObject"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="fieldsToNull" nillable="true" type="xsd:string"/> <element name="Id" nillable="true" type="tns:ID"/> </sequence> <attribute name="xsi:type" type="xsd:string"/> </complexType> <element name="upsert"> <complexType> <sequence> <element name="externalIDFieldName" type="xsd:string"/> <element maxOccurs="unbounded" minOccurs="0" name="sObjects" type="xsd:anyType"/> </sequence> </complexType> </element>
add manually namespace and prefix to BW process and fill @type attribute.
Subskrybuj:
Posty (Atom)