Connecting Microsoft Dynamics GP10 web services – using Java


Use the  below java code to connect MS dynamics GP10


import java.net.URL;

import java.rmi.RemoteException;

import java.util.Hashtable;

import java.io.File;

import java.io.FileInputStream;

import java.io.IOException;

import java.net.MalformedURLException;

import java.net.URL;

import java.rmi.RemoteException;

import java.util.Hashtable;

import java.util.Properties;

import org.apache.axis.SimpleTargetedChain;

import org.apache.axis.client.AxisClient;

import org.apache.axis.configuration.SimpleProvider;

import org.apache.axis.transport.http.CommonsHTTPSender;

import org.apache.log4j.Logger;

import javax.naming.Context;

import javax.naming.InitialContext;

import javax.xml.namespace.QName;

import javax.xml.rpc.ServiceException;

import com.microsoft.schemas.dynamics._2006._01.CompanyKey;

import com.microsoft.schemas.dynamics._2006._01.CurrencyType;

import com.microsoft.schemas.dynamics._2006._01.OrganizationKey;

import com.microsoft.schemas.dynamics.gp._2006._01.CurrencyKey;

import com.microsoft.schemas.dynamics.gp._2006._01.Dynamics_x0020_GPLocator;

import com.microsoft.schemas.dynamics.gp._2006._01.Dynamics_x0020_GPSoap;

import com.microsoft.schemas.dynamics.gp._2006._01.GetInventoriedItemByKey;

import com.microsoft.schemas.dynamics.gp._2006._01.Item;

import com.microsoft.schemas.dynamics.gp._2006._01.ItemCriteria;

import com.microsoft.schemas.dynamics.gp._2006._01.ItemKey;

import com.microsoft.schemas.dynamics.gp._2006._01.ItemSummary;

import com.microsoft.schemas.dynamics.gp._2006._01.LikeRestrictionOfString;

import com.microsoft.schemas.dynamics.gp._2006._01.Service;

import org.apache.axis.client.Stub;

public class GPConnect {

public static void main(String args[]) {

String endpoint = “http://xxxx:PORT/DynamicsGPWebServices/DynamicsGPService.asmx”;

String username=”domain\\xxxx”;

String password = “xxxxx”;

CompanyKey companyKey = null;

String currencyType = “Transactional”;

String cultureName = “en-US”;

String portNumber = “”;

String roleKey = null;

Dynamics_x0020_GPSoap stub;

com.microsoft.schemas.dynamics.gp._2006._01.Dynamics_x0020_GPLocator locator = new Dynamics_x0020_GPLocator();

locator.setDynamics_x0020_GPSoap12EndpointAddress(endpoint);

com.microsoft.schemas.dynamics._2006._01.Context context= new com.microsoft.schemas.dynamics._2006._01.Context();

try {

stub = locator.getDynamics_x0020_GPSoap12();

((Stub)stub).setUsername(username);

((Stub)stub).setPassword(password);

Hashtable headers = new Hashtable();
headers.put(“chunked”, “false”);
headers.put(“Connection”,”keep-alive”);
((Stub)stub)._setProperty(“HTTP-Request-Headers”, headers);
System.out.println(“StubCreated”);

ItemCriteria criteria= new ItemCriteria();
LikeRestrictionOfString itemClassId= new LikeRestrictionOfString();
itemClassId.setEqualValue(“CATALOG”);
criteria.setItemClassId(itemClassId)

context.setCultureName(“en-US”);
CurrencyType cuType = new CurrencyType(“Transactional”);
context.setCurrencyType(cuType);
companyKey = new CompanyKey();
companyKey.setId(-1);

OrganizationKey orgkey=(OrganizationKey)companyKey;
context.setOrganizationKey(orgkey);
ItemKey key = new ItemKey(“128 SDRAM”);
Item o = stub.getItemByKey(key , context);
System.out.println(o.getDescription());

} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printmessage()
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printmessage()
}
}
}

 


Thanks for reading this article!! please leave your comments and suggestion about this article.

How to Show information / warnings in SharePoint


In SharePoint , Status bar is used to display information / warnings  using Javascript.This script is added at the client side.


The status script functions are listed out in the SP.UI.Status class. in SP.js which is added in master page by default.

The SP.UI.Status class has 6 functions.

           1. addStatus   – used to add the status bar information

           2. appendStatus  – used to append the information

           3. removeAllStatus – remove all  status

           4. removeStatus – remove status

           5. setStatusPriColor – used to set color for the status bar information

           6. updateStatus – update  / replage the status information

So simply follow the steps the to add the information / warning in SharePoint  site.


 1. Add a Script Editor / Content editor web part in the page



2. Edit snippet and add the below code to show the information.

window.onload = function(){

var Status;

Status = SP.UI.Status.addStatus(“Information : “, “ We sincerely apologize for the inconvenience.Our site is currently undergoing maintenance and upgrades and will return return shortly.“, true);

  SP.UI.Status.setStatusPriColor(Status, “yellow”);

  }


3. Save the page and refresh.


Now the page looks as below



Woo hoo , Now its very simple to show the notification for alerts/ warnings in SharePoint site.


For more info , refer https://goo.gl/45xmbX

Thanks for reading this article!! please leave your comments and suggestion about this article.

http error 503. the service is unavailable in IIS after enabling 32 bit application


By default, IIS running on a 64 bit computer does not support running a 32 bit application. However, you can change the setting in an Application Pool under which the application is running by setting the ‘Enable 32-bit Applications‘ to true

In IIS, I created a new web-site and change the application pool to enable 32-bit application to support my 32 bit application.

While accessing the apppplication i got the  “HTTP Error 503. The service is unavailable” error.

Also Identified that the application pool was stopped repeatedly when i tried to access the  application. Finally got the below error from event viewer.

The Module DLL ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

Solution:

Run the following command in Windows Command Prompt. 


"%systemroot%\system32\inetsrv\AppCmd.exe" set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64

This  will solve the problem to load SPNativeRequestModule when the application pool is running in Integrated Mode and 64-bit application mode.

Hope the issue solved !!

Thanks for reading this article!! please leave your comments and suggestion about this article.

retrieving the com class factory for component with clsid 80040154 Retrieving the COM class factory for component with CLSID {…} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)


PROBLEM:

When you run the .net Code in X64 Environment you will get the following error message.

” Failed –Retrieving the COM class factory for component with CLSID ….”

E.g. in Retrieving the COM class factory for component with CLSID {94773112-72E8-11D0-A42E-00A024DED613} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

WORKAROUND:

The possible workaround is modify your project’s platform from ‘Any CPU’ to ‘X86’ (in Project’s Properties, Build/Platform’s Target)

ROOTCAUSE

The VSS Interop is a managed assembly using 32-bit Framework and the dll contains a 32-bit COM object. If you run this COM dll in 64 bit environment, you will get the error message.

SOLUTION

  1. Open IIS
  2. Select  the application pool used by your website
  3. Click Advanced setting
  4. enable 32-bit Application to TRUE which was set to False by default.
  5. Restart IIS
  6. Now its resolved. 🙂

settings

 

 

 

 

 

 

 

 

 

Thanks for reading this article!! please leave your comments and suggestion about this article.

Bootstrap – A Perfect framework for web Development


In the my Recent projects , i am came across various framework for .Net based web Application. But quite interested and flexible framework is Bootstrap

Bootstrap – a new start-up for more creativity in web developments.

Bootstrap is a powerful front-end framework for faster and easier web development. It includes HTML and CSS based design templates for common user interface components.

Also gives more ability  to create responsive layout.

why we have to opt  Bootstrap:

  • Responsive layout
  • easy to use
  • Compatible with most of the browsers.
  • Open Source –  completely free to download and use

To Download GetBootstrap here

Bootstrap comes with CSS , javascript in the  form of jquery

Structure:

structure

 

http://getbootstrap.com/javascript/

My first Example, i always used to copy the code from the examples given and give a try.

code

boot modalThanks for reading this article!! please leave your comments and suggestion about this article.

 

 

How to connect Microsoft Dynamics GP using API methods


The following are the types to integrate Microsoft Dynamics GP  from other Applications

1. Component Object Model (COM) API

Using the COM dll ,  develop Visual studio application for the integration.


2. eConnect

  eConnect is a collection of tools, components, and interfaces that allow applications to pro grammatically interact with Microsoft Dynamics GP. eConnect interfaces allow external applications to integrate with Microsoft Dynamics GP. The external applications can perform actions like creating, updating, retrieving, and deleting back office documents and transactions. 

An eConnect integration also reduces costs by reducing data re-entry

3. Integration Manager

 Integration manager  is  an integration tool used to convert and transfer data other application in to Microsoft Dynamics GP.(Trial Version – 90 days)

4. Dynamics GP Web Services

Using web services able to convert and transfer data to other application(vice versa).Also through Web services management console user data access can be restricted.


Behind web services , eConnect API is used to integrate with Dynamics GP.

Thanks for reading this article!! please leave your comments and suggestion about this article.

Images and CSS not shown in website hosted in IIS Server 7.5


Recently I came across a unseen problem.

A website working perfectly While debugging using Visual studio 2010 . All the Images and CSS are loaded perfectly as expected.

However when I hosted the web site in IIS Server version 7.5 , CSS and Image files are not shown in the website.

After a long research , Finally found that the Static Content handler is not enabled in the IIS Server.

After Enabling Static content , issue got fixed. Now the Images and CSS are shown in the Website as expected.

To Enable Static content Handler :

1. Open Turn Windows Features On or Off

2. Select Internet Information Services

3. Then World Wide Web Services

4. Under Common HTTP Features Check the Static Content,

5. Click Ok.

iis

 

Thanks for reading this article!! please leave your comments and suggestion about this article.