Friday, 19 December 2014

To generate the Java code from WSDL using axis 1.4 version and axis2

Using Axis 1.4
Download and Install
JDK -
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
-- Use  default path for the installation

axis-bin-1_4.zip or axis-src-1_4.zip
http://archive.apache.org/dist/ws/axis/1_4/

-- Unzip and place axis-1_4 in C:\

SET Environment Variables
Select Start -> Control Panel -> System -> Advanced -> Environment Variables -> System Variables

set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_25"
set PATH=%JAVA_HOME%\bin;%PATH%
set AXIS_HOME="C:\axis-1_4"
CLASSPATH = C:\axis-1_4\lib

Create Input and Output Folders
Create c:\wsdl folder and place the wsdl file provided
Create c:\output folder for Java code generation

Command to execute
C:\axis-1_4\lib>java -classpath activation.jar;mailapi.jar;axis.jar;jaxrpc.jar;saaj.jar;commons-logging-1.0.4.jar;commons-discovery-0.2.jar;wsdl4j-1.5.1.jar;log4j-1.2.8.jar; org.apache.axis.wsdl.WSDL2Java -s C:\wsdl\<WDSL_NAME>.wsdl -o C:\output -p <PACKAGE_NAME> -t
- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
C:\axis-1_4\lib>

                Note – ignore the above error which is underlined.

More info on the command params for reference -
  -s Generate sync style code only (Default: off). Takes precedence over -a.
  -o Specify a directory path for the generated code.
  -p Specify a custom package name for the generated code.
  -t Generate a test case for the generated code.

------------------------------------------------------------
Implementation –
------------------------------------------------------------
Once we have the Java code generated from the WSDL.  We will have to create a command implementation that will invoke the webservice by passing the request parameters.  The request params for the Headers and Body will be purely based on the WDSL provided.

------------------------------------------------------------
Testing -
By passing –t as parameter to the above command Junit test case will be generated which can be used for Unit Test.


------------------------------------------------------------

Using Axis2


set ANT_HOME=C:\apache-ant-1.8.2

set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25

set PATH=C:\apache-ant-1.8.2\bin;C:\Program Files\Java\jdk1.8.0_25\bin

set ANT_OPTS=-Xms256M -Xmx512M

URL -
http://localhost:8080/axis2/services/

Command to generate Code
C:\axis2-1.6.2\bin\wsdl2java.bat -uri <WSDL_PATH> -d adb -s -ss -sd -ssi -o <OUT_PUT_FOLDER_PATH>\service


C:\axis2-1.6.2\bin\wsdl2java.bat -uri <WSDL_PATH> -d adb -o <OUT_PUT_FOLDER_PATH>\client

- Once the files are generated - Create a Client file - to invoke the webservice by setting the request params for the SOAP request.

- Use the file with name < ..Skeleton.java> to write the Business logic for the response SOAP request.


Thursday, 4 December 2014

To set the variable in JSP for partialCredentialsUsed

<c:set var="partial" value="${CommandContext.deviceFormatAdapter.sessionContext.partialCredentialsUsed}"/>    
Commands to setup Solr in Websphere Commerce 

For Catalog Solr Data Setup and Index
                C:\WCDE_ENT70\components\foundation\subcomponents\search\bin>setupSearchIndex.bat -masterCatalogId 10001

C:\WCDE_ENT70\bin>di-preprocess.bat C:\WCDE_ENT70\search\pre-processConfig\MC_10001\DB2\ -fullbuild true -force true

Bring the server up and test it using -      http://localhost/solr/Default/select?q=*%3A* 

C:\WCDE_ENT70\bin>di-buildindex.bat -masterCatalogId 10001

http://localhost/solr/MC_10001_CatalogEntry_en_US/select?q=catentry_id:10251

For Inventory Solr Data Setup and Index
                C:\WCDE_ENT70\components\foundation\subcomponents\search\bin\setupSearchIndex.bat -masterCatalogId 10001 -indexSubType Inventory

C:\WCDE_ENT70\bin>di-preprocess.bat C:\WCDE_ENT70\search\pre-processConfig\MC_10001\DB2\SubTypes\Inventory -force true

Bring the server up and test it using -      http://localhost/solr/Default/select?q=*%3A* 

C:\WCDE_ENT70\bin>di-buildindex.bat -masterCatalogId 10001 -indexSubType Inventory -force true

http://localhost/solr/MC_10001_CatalogEntry_Inventory_generic/select?q=*&fq=catentry_id:( 13331 13332 )
               
               

Friday, 17 October 2014

To disable Cross Site Scripting in Management Center.

Open the following file:
LOBTools.war/WEB-INF/web.xml

Search for and remove the following snippet:

<param-name>com.ibm.commerce.security.crosssitescriptingprovider</param-name> 
<param-value>com.ibm.commerce.foundation.internal.client.security.impl. 
ClassicCommerceCrossSiteScriptingProviderImpl</param-value>

Save your changes and close the file.

Deploy your changes.

Wednesday, 30 July 2014

Tips to propagate the data using stageprop in a short amount of time.

The value for the batch size and transaction size parameters can help to propagate large amounts of data in a short amount of time in comparison to the OOB StagingProp utility from WCS 7 Fixpack 5 and prior.

However, we can make use of the STAGLOG.STGFILTER column to mark particular rows in the STAGLOG table to be propagated. When you run the StagingProp utility, you specify the filter parameter with the filter value and only records in the STAGLOG table with the associated filter value will be propagated to production.  Even the oracle streaming concept can be of much help with this approach. 

Another option is to use of the scope parameter. The parameter can be used to propagate changes for specific tables.

Thursday, 24 July 2014


Business Context Service instead of Http session or Cookies

Apart from the Http session or cookies, You can also take a look at using the Business Context Service option which is available for maintaining the information throughout the user activity and invalidating it when the user logs out or the browser is closed.

The context data will be available in tables, CTXMGMT and CTXDATA


To create a Custom Business Context Service -

  • Create a new Interface for the custom context  by extending the com.ibm.commerce.context.base.Context interface.
  • Create a context implementation class that implements the custom interface created before extending the com.ibm.commerce.context.baseimpl.AbstractContextImpl.
  • Registering new Business Context by making an entry in businessContext.xml or Create a new businessContext.xml. Register this new businessContext.xml in the wc-server.xml under the BusinessContextService element and then use it.
  • You can then push the values from the controller command into the context and then use it across the application.

Tuesday, 8 July 2014

Troubleshooting DynaCache invalidation fails to clear the cache

When:
1) Running the DynaCacheInvalidation scheduled job with the 'clearall' value specified in the CACHEIVL table.
2) Calling the DynaCacheInvalidation URL directly with clear=true passed as a parameter value.

(https://<domainname>:8000/webapp/wcs/tools/servlet/DynaCacheInvalidation?clear=true)

No errors are thrown in the logs and using the 'Clear Cache' button in the Cache Monitor clears the cache as expected.

From the traces you will notice that the logs indicate the wrong cacheName is referenced, which point to a recommended fix not being installed.

[9/27/10 15:19:51:504 MDT] 000000b2 WC_CACHE > com.ibm.commerce.dynacache.commands.DCInvalidationCmdImpl performExecute Entry
[9/27/10 15:19:51:504 MDT] 000000b2 Cache 3 clear() cacheName=default waitOnInvalidation=true

The cacheName should be "baseCache", not "default".

This issue is addressed in the WAS APAR PK77428. This fix is included in WAS V7.0.0.5 if you prefer upgrading your WAS Fix Pack level.

Thursday, 3 July 2014


Configuration for Facet display on Store Front 

If the MAX_DISPLAY column in the FACET value is set too low, some categories might not show up correctly.

To resolve this issue:
  1. Set the MAX_DISPLAY column in the FACET table to -1.
  2. Set the displayChildCategoriesOnly property to true in your custom wc-component.xml file.

Monday, 30 June 2014

Enabling additional performance information for dataload.

Update the load order file with the below snippet

<config:property name="summaryReportLevel" value="1" />