August 24, 2012

Setting up Currency ISO Code in Microsoft Dynamics GP


The Dynamics GP web service uses ISO codes to identify currencies in Microsoft
Dynamics GP.

Note: Web Services for Microsoft Dynamics GP does not support using the same ISO code for more than one currency.

To add ISO codes, complete the following procedure:

 1.  Open the Currency Setup window in Microsoft Dynamics GP.

          Choose Microsoft Dynamics GP menu >> Tools >> Setup >> System >>
          Currency and enter the system password to display this window.


 2. Display each currency.

            Use the Currencies lookup to display each currency.
            Press (Ctrl + L) or click the search icon to display the below window.


3. Select the Currency to set the ISO code
    
        For e.g. select US Dollars, the Following window appears.


4. Enter the ISO value and save the currency.

Enter the code in the ISO Code Text Field.
The following table lists the ISO values for the currencies commonly defined in
Microsoft Dynamics GP:

ISO Code
Country/Region
Currency
USD
United States
Dollars
AUD
Australia
Dollars
CAD
Canada
Dollars
EUR
European Union
Euros
JPY
Japan
Yen
MXN
Mexico
Pesos
SGD
Singapore
Dollars
NZD
New Zealand
Dollars

 5. Save and Exit.

After entering the ISO code save the Currency and close the window.


Now the Currency set up is finished and able to access through GP web services.

August 21, 2012

Consume Any Web Service Using Eclipse + Axis


  1. Start Eclipse and create a new workspace named wsTest (click File -> Switch Workspace -> Other…)


  2. Create a new Java Project named wsTest (click File -> New -> Java Project)


  3. Create a new Web Service Client Proxy (click File -> New -> Other -> Web Services -> Web Service Client). In this case we are consuming a free, public web service that returns weather information for the United States. The URL for the WSDL definition is http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl.


  4. Create a new Java Class named Test.java (click File -> New -> Class)


  5. Copy and paste the following code into Test.java (overwrite the existing code):
    Test.java - double click to select all
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    import com.cdyne.ws.WeatherWS.*;
    import java.net.URL;
     
    public class Test
    {
     public static void main(String[] arg)
     {
      try
      {
       WeatherSoapStub service = (WeatherSoapStub)new WeatherLocator().getWeatherSoap(new URL("http://ws.cdyne.com/WeatherWS/Weather.asmx"));
       WeatherReturn weather = service.getCityWeatherByZIP("47710");
       System.out.println("Location: " + weather.getCity() + ", " + weather.getState());
       System.out.println("Description: " + weather.getDescription());
       System.out.println("Temperature: " + weather.getTemperature() + " degrees");
      }
      catch (Exception e)
      {
       e.printStackTrace();
      }
     }
    }

    Note that we set the endpoint URL on line 10. The endpoint URL is typically the same as the WSDL definition URL except the endpoint URL does not include the ?WSDL query string parameter.
  6. Execute the code (click Run -> Run)

    You should see something resembling the following output:

    Location: Evansville, IN
    Description: Sunny
    Temperature: 49 degrees