After logging into your geoserver web portal, just check the Layer Preview option.
This lists all layers configured in geoserver. You can search for your shapefile in this list. This will have a dropdown option at the last as shown below:
Your complete WMS url consists of a number of parameters as mentioned below:
- SERVICE: Its value is WMS.
- VERSION: It can be 1.0.0, 1.1.0 or 1.3.0.
- REQUEST: GetMap, GetCapabilities or GetFeatureInfo.
- LAYERS: It is decided by the client which layers to display.
- TRANSPARENT: True or False. Whether we want to make the blank space left by the image to be transparent or opaque (Optional).
- STYLES: It defines the style in the displayed layers. This can be blank if displaying only raster images (Optional).
- FORMAT: This can be image/png, image/jpg or image/gif. Generally image/png is used.
- SRS: It represents the Spatial Reference system of the viewer. Generally its value is EPSG:4326.
- CRS: It represents the Coordinate Reference System. This is mandatory in version 1.3.0. Generally its value is CRS:84.
- BBOX: It represents the boundary box of the requested image. Its format is
- WIDTH: It is the width of the requested image in pixels. Generally, it value is 256.
- HEIGHT: It is the height of the requested image in pixels. Generally, it value is 256.
- DPI: It represents dots per inch. Its value is client-dependent. Generally
its value is 96 (Optional).
- BGCOLOR: It represents the color to be used as the background (non-data) pixels of the map represented in hexadecimal prefixed by 0x (Optional).
You can click on JPEG from this dropdown and see the url (for JPEG format). It will look something like
You need to change the store name, layer name and bbox option above.