07 - WSDL 2.0 Service Element

The service element specifies where your web services can be accessed. It describes the endpoint where anyone that wants to consume your web service will have to access in order to access the actual service. Each endpoint will reference a previously defined binding indicating the protocol and transmission format to be used at the endpoint.

The following is an example of the service element in a WSDL 2.0 file. 

<service name = "myService" 
       interface = "tns: myServiceInterface">
     <endpoint name = "myServiceEndpoint" 
               binding = "tns:myServiceInterfaceSOAPBinding"
               address = "http://yoursite.com/MyService"/>
</service>

Service

A service element has the following attributes:

          <service name = "myService"

The name attribute defines the name of the service. Every service name must be unique within the WSDL 2.0 target namespace.

          interface = "tns: myServiceInterface">

The interface attribute defines the name of the interface (previously defined in the WSDL 2.0) that the service endpoints will be about.

Endpoint

The endpoint element within the service element defines the address of the web service.

          <endpoint name = "myServiceEndpoint"

The name attribute of the endpoint element defines the name for the endpoint which must be unique within the services.

          binding = "tns:myServiceInterfaceSOAPBinding"

The binding attribute of the endpoint element specifies which previously defined binding this endpoint will be using.

          address = "http://yoursite.com/MyService"/>

The address attribute of the endpoint element specifies the physical address where the service will be available.

Like us on Facebook