Product
The following methods are available for managing the product entity using the Entity API Service.
Note: The following imports are required for all of the Java code examples on this page.
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import com.pervasive.datasolutions.api.service.EntityAPIServiceLocator;
import com.pervasive.datasolutions.api.service.EntityAPIService;
import com.pervasive.datasolutions.api.crud.CloudAPIException;
import com.pervasive.datasolutions.api.crud.InvalidSessionException;
import com.pervasive.datasolutions.api.entity.*;
import com.pervasive.datasolutions.api.crud.*;
Tip... Use the
login method to start a session and obtain the sessionId parameter. See
Login and Logout.
listProducts
Lists the products associated with the current user. Includes products the user owns as well as products for which the user owns provisionings.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:listProducts>
<firstResult>0</firstResult>
<maxResults>100</maxResults>
<sessionId>125003101222.7BEA.3DC4.0FDA.41CC.93F0.B130</sessionId>
</crud:listProducts>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:listProductsResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return id="0d2c6593-9482-483b-a913-9cef2be60d55">
<owner id="171">shuckertestuser</owner>
<active>true</active>
<concurrent>false</concurrent>
<description>big test product</description>
<destination>390</destination>
<name>Big Test Product</name>
<parameters/>
<parentProvisioningId>13351</parentProvisioningId>
<process>p_WrapperProcess.ip.xml</process>
<userProduct>true</userProduct>
</return>
<return id="IDSSLEU-E01W201-91900-01">
<owner id="335">dsadmin</owner>
<active>true</active>
<concurrent>false</concurrent>
<description>Finds duplicates in Salesforce.com</description>
<destination>390</destination>
<name>Sleuth</name>
<parameters>
<parameter key="salesforce.com.username"/>
<parameter key="salesforce.com.password"/>
</parameters>
<process>sleuth.djar</process>
<userProduct>false</userProduct>
</return>
<ns2:listProductsResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final int firstResult = 0;
final int maxResults = 100;
final String sessionId = "125003101227.4253.DC58.5A73.4AC1.AED2.5687";
import java.util.List;
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
com.pervasive.datasolutions.api.crud.EntityAPIService stub = service.getEntityAPIPort();
List<Product> prod = stub.listProducts(firstResult, maxResults, sessionId);
listProductsByGroup
List the products associated with the specified group.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:listProductsByGroup>
<firstResult>0</firstResult>
<maxResults>1</maxResults>
<id>2</id>
<sessionId>560ee69a-c0cd-4f11-9579-4cda37be4220</sessionId>
</crud:listProductsByGroup>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:listProductsByGroupResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return id="NewProductSku-1318439727860" permissions="">
<owner id="171">shuckertestuser</owner>
<account>1</account>
<active>true</active>
<concurrent>true</concurrent>
<createdby>171</createdby>
<deleted>false</deleted>
<description>Edited successfully</description>
<destination>390</destination>
<group>2</group>
<integrationspec>Tiara</integrationspec>
<lastmodifiedby>171</lastmodifiedby>
<name>ProductSKU8</name>
<parameters>
<parameter key="myProductKey8">myProductValue8</parameter>
</parameters>
<parentProvisioningId>15046</parentProvisioningId>
<process>defaultProcess.ip.xml</process>
<userProduct>true</userProduct>
</return>
</ns2:listProductsByGroupResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final int firstResult = 0;
final int maxResults = 100;
final Long id = 2;
final String sessionId = "125003101227.4253.DC58.5A73.4AC1.AED2.5687";
import java.util.List;
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
List<Product> prod = stub.listProductsByGroup(firstResult, maxResults, id, sessionId);
findProduct
Return a product by ID.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:findProduct>
<sku>0d2c6593-9482-483b-a913-9cef2be60d55</sku>
<sessionId>125003101222.7BEA.3DC4.0FDA.41CC.93F0.B130</sessionId>
</crud:findProduct>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:findProductResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return id="0d2c6593-9482-483b-a913-9cef2be60d55">
<owner id="171">testuser</owner>
<active>true</active>
<concurrent>false</concurrent>
<description>big test product</description>
<destination>390</destination>
<name>Big Test Product</name>
<parameters/>
<parentProvisioningId>13351</parentProvisioningId>
<process>p_WrapperProcess.ip.xml</process>
<userProduct>true</userProduct>
</return>
</ns2:findProductResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String sku = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String sessionId = "125003101222.7BEA.3DC4.0FDA.41CC.93F0.B130";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
Product p = stub.findProduct(sku, sessionId);
createProduct
Create a new product associated with the current user.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:createProduct>
<product permissions="?" id="43546">
<owner id="171">testuser</owner>
<account>100</account>
<active>true</active>
<concurrent>true</concurrent>
<createdby>171</createdby>
<createddate>2011-11-02T00:00:00-04:00</createddate>
<deleted>false</deleted>
<description>datacloud Documentqation</description>
<destination>390</destination>
<group>145</group>
<integrationspec>Tiara</integrationspec>
<lastmodifiedby>171</lastmodifiedby>
<lastmodifieddate>2011-11-01T00:00:00-04:00</lastmodifieddate>
<name>Product1</name>
<parameters>
<!--Zero or more repetitions:-->
<parameter key="myProductKey" secure="no">myProductValue</parameter>
</parameters>
<parentProvisioningId>15046</parentProvisioningId>
<process>defaultProcess.ip.xml</process>
<startdate>2011-10-24T00:00:00-04:00</startdate>
<userProduct>true</userProduct>
</product>
<sessionId>82f379ab-44e4-4d04-b0da-7c11404cfd99</sessionId>
</crud:createProduct>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:createProductResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return id="43546" permissions="">
<owner id="171">testuser</owner>
<account>1</account>
<active>true</active>
<concurrent>true</concurrent>
<createdby>171</createdby>
<deleted>false</deleted>
<description>datacloud Documentqation</description>
<destination>390</destination>
<group>145</group>
<integrationspec>Tiara</integrationspec>
<lastmodifiedby>171</lastmodifiedby>
<name>Product1</name>
<parameters>
<parameter key="myProductKey">myProductValue</parameter>
</parameters>
<parentProvisioningId>15046</parentProvisioningId>
<process>defaultProcess.ip.xml</process>
<userProduct>true</userProduct>
</return>
</ns2:createProductResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String sessionId = "125003101227.4253.DC58.5A73.4AC1.AED2.5687";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
Product newProduct = new Product();
newProduct.setActive(true);
newProduct.setConcurrent(true);
User u=new User();
newProduct.setCreatedby(u);
newProduct.setCreateddate((long) (2010-05-14));
newProduct.setDeleted(true);
newProduct.setGroup(2);
newProduct.setDescription("Integration Product");
newProduct.setDestination("390");
newProduct.setGroup(2);
newProduct.setId("0d2c6593-9482-483b-a913-9cef2be60d100");
newProduct.setIntegrationspec("integrationspec");
newProduct.setLastmodifiedby(u);
newProduct.setLastmodifieddate((long) (2010-05-14));
newProduct.setName("testproduct");
UserInfo uf=new UserInfo();
uf.setId(172);
uf.set_value("testuser");
newProduct.setOwner(uf);
ProductParameter[] pparameter=new ProductParameter[5];
pparameter[0].setKey("productKey");
pparameter[0].set_value("productKeyValue");
pparameter[0].setSecure(true);
newProduct.setParameters(pparameter);
newProduct.setParentProvisioningId((long) 13351);
newProduct.setPermissions("READ");
newProduct.setProcess("p_WrapperProcess.ip.xml");
newProduct.setStartdate((long) (2010-05-14));
newProduct.setUserProduct(true);
Product product = stub.createProduct(newProduct, sessionId);
editProduct
Edit a designated product associated with the current user.
Parameters
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:editProduct>
<!--Optional:-->
<product permissions="?" id="43546">
<owner id="171">testuser</owner>
<account>100</account>
<active>true</active>
<concurrent>true</concurrent>
<createdby>171</createdby>
<createddate>2011-11-02T00:00:00-04:00</createddate>
<deleted>false</deleted>
<description>Updated Product</description>
<destination>390</destination>
<group>145</group>
<integrationspec>Pervasive</integrationspec>
<lastmodifiedby>171</lastmodifiedby>
<lastmodifieddate>2011-11-01T00:00:00-04:00</lastmodifieddate>
<name>NewProduct</name>
<parameters>
<!--Zero or more repetitions:-->
<parameter key="myProductKey1" secure="no">myProductValue1</parameter>
</parameters>
<parentProvisioningId>15046</parentProvisioningId>
<process>defaultProcess.ip.xml</process>
<startdate>2011-10-24T00:00:00-04:00</startdate>
<userProduct>true</userProduct>
</product>
<sessionId>82f379ab-44e4-4d04-b0da-7c11404cfd99</sessionId>
</crud:editProduct>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:editProductResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity"/>
</S:Body>
</S:Envelope>
Java Code Sample
final String sessionId = "125003101227.4253.DC58.5A73.4AC1.AED2.5687";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
Product editedProduct=new Product();
editedProduct.setActive(true);
editedProduct.setConcurrent(true);
User u=new User();
editedProduct.setCreatedby(u);
editedProduct.setCreateddate((long) (2010-05-14));
editedProduct.setDeleted(true);
editedProduct.setDescription("Integration Product");
editedProduct.setDestination("390");
editedProduct.setGroup(2);
editedProduct.setId("0d2c6593-9482-483b-a913-9cef2be60d100");
editedProduct.setIntegrationspec("integrationspec");
editedProduct.setLastmodifiedby(u);
editedProduct.setLastmodifieddate((long) (2010-05-14));
editedProduct.setName("testproduct");
UserInfo uf=new UserInfo();
uf.setId(172);
uf.set_value("testuser");
editedProduct.setOwner(uf);
ProductParameter[] pparameter=new ProductParameter[5];
pparameter[0].setKey("productKey");
pparameter[0].set_value("productKeyValue");
pparameter[0].setSecure(true);
editedProduct.setParameters(pparameter);
editedProduct.setParentProvisioningId((long) 13351);
editedProduct.setPermissions("READ");
editedProduct.setProcess("p_WrapperProcess.ip.xml");
editedProduct.setStartdate((long) (2010-05-14));
editedProduct.setUserProduct(true);
stub.editProduct(editedProduct, sessionId);
deleteProduct
Delete a designated product associated with the current user.
Parameters
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:deleteProduct>
<sku>0d2c6593-9482-483b-a913-9cef2be60d100</sku>
<sessionId>125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7</sessionId>
</crud:deleteProduct>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:deleteProductResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity"/>
</S:Body>
</S:Envelope>
Java Code Sample
final String sku = "0d2c6593-9482-483b-a913-9cef2be60d100";
final String sessionId = "125003101227.4253.DC58.5A73.4AC1.AED2.5687";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
stub.deleteProduct(sku, sessionId);
getProductCount
Count the products associated with the current user. Includes products not owned by the current user, but for which the user has provisionings.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:getProductCount>
<sessionId>125003101222.7BEA.3DC4.0FDA.41CC.93F0.B130</sessionId>
</crud:getProductCount>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getProductCountResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>14</return>
</ns2:getProductCountResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String sessionId = "125003101227.4253.DC58.5A73.4AC1.AED2.5687";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
Long Count=stub.getProductCount(sessionId);
getProductParameter
Returns the value of a paramater associated with a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:getProductParameter>
<sku>0d2c6593-9482-483b-a913-9cef2be60d55</sku>
<key>parameterkey</key>
<sessionId>125003101223.6634.326B.C412.41CD.8643.4190</sessionId>
</crud:getProductParameter>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getProductParameterResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud"
xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>parametervalue</return>
</ns2:getProductParameterResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String sku = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String key = "parameterKey";
final String sessionId = "125003101223.6634.326B.C412.41CD.8643.4190";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
String ProductParameter=stub.getProductParameter(sku, key, sessionId);
putProductParameter
Store a key/value pair associated with a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:putProductParameter>
<sku>0d2c6593-9482-483b-a913-9cef2be60d55</sku>
<key>parameterkey</key>
<value>parametervalue</value>
<sessionId>125003101223.6634.326B.C412.41CD.8643.4190</sessionId>
</crud:putProductParameter>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:putProductParameterResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity"/>
</S:Body>
</S:Envelope>
Java Code Sample
final String sku = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String key = "parameterKey";
final String value = "parameterValue";
final String sessionId = "125003101223.6634.326B.C412.41CD.8643.4190";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
String ProductParameter=stub.putProductParameter(sku, key, value, sessionId);
removeProductParameter
Remove a parameter from a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:removeProductParameter>
<sku>0d2c6593-9482-483b-a913-9cef2be60d55</sku>
<key>parameterkey</key>
<sessionId>125003101223.6634.326B.C412.41CD.8643.4190</sessionId>
</crud:removeProductParameter>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:removeProductParameterResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>parametervalue</return>
</ns2:removeProductParameterResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String sku = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String key = "parameterKey";
final String sessionId = "125003101223.6634.326B.C412.41CD.8643.4190";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
com.pervasive.datasolutions.api.crud.EntityAPIService stub = service.getEntityAPIPort();
String ParameterValue=stub.removeProductParameter(sku, key, sessionId);
listProductFiles
List files associated with a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:listProductFiles>
<productId>0d2c6593-9482-483b-a913-9cef2be60d55</productId>
<sessionId>125003101223.6634.326B.C412.41CD.8643.4190</sessionId>
</crud:listProductFiles>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:listProductFilesResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>p_WrapperProcess.ip.xml</return>
<return>test.ip.xml.txt</return>
</ns2:listProductFilesResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String productId = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String sessionId = "125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7";
import java.util.List;
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
List<String> productfiles = stub.listProductFiles(productId, sessionId);
getProductFile
Download a designated file associated with a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:getProductFile>
<productId>0d2c6593-9482-483b-a913-9cef2be60d55</productId>
<filename>p_WrapperProcess.ip.xml</filename>
<sessionId>125003101223.6634.326B.C412.41CD.8643.4190</sessionId>
</crud:getProductFile>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getProductFileResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud"
xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVCBYTUwgPT09PT09LS0+DQo8IS0tIDwhR</return>
</ns2:getProductFileResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String productId = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String filename = "testproductfile.txt";
final String sessionId = "125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7";
import javax.activation.DataHandler;
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
DataHandler d=stub.getProductFile(productId, filename, sessionId);
putProductFile
Upload a file associated with a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:putProductFile>
<productId>0d2c6593-9482-483b-a913-9cef2be60d56</productId>
<filename>testproductfile</filename>
<data>cid:893016213814</data>
<sessionId>125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7</sessionId>
</crud:putProductFile>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:putProductFileResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>9</return>
</ns2:putProductFileResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String productId = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String filename = "testproductfile.txt";
final String sessionId = "125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7";
import javax.activation.DataHandler;
import javax.activation.DataSource;
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
Long size = 0L;
InputStream in= new FileInputStream(filename);
DataSource dataSource = new DataSource() {
@Override
public InputStream getInputStream() throws IOException {
return in;
}
@Override
public OutputStream getOutputStream() throws IOException {
return null;
}
@Override
public String getContentType() {
return "application/octet-stream";
}
@Override
public String getName() {
return filename;
}
};
DataHandler dataHandler = new DataHandler(dataSource);
filesize = stub.putProductFile(productId, filename, dataHandler, sessionId);
deleteProductFile
Delete a designated file associated with a specified product.
Parameters
Returns
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crud="http://datasolutions.pervasive.com/api/crud">
<soapenv:Header/>
<soapenv:Body>
<crud:deleteProductFile>
<productId>0d2c6593-9482-483b-a913-9cef2be60d56</productId>
<filename>testproductfile</filename>
<sessionId>125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7</sessionId>
</crud:deleteProductFile>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:deleteProductFileResponse xmlns:ns2="http://datasolutions.pervasive.com/api/crud" xmlns:ns3="http://datasolutions.pervasive.com/api/entity">
<return>10</return>
</ns2:deleteProductFileResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String productId = "0d2c6593-9482-483b-a913-9cef2be60d55";
final String filename = "testproductfile.txt";
final String sessionId = "125003101226.E179.E9D3.3DA5.4598.A2DE.C3A7";
EntityAPIServiceLocator service = new EntityAPIServiceLocator();
EntityAPIService stub = service.getEntityAPIPort();
stub.deleteProductFile(productId, filename, sessionId);