You almost have Darin's answer - you need to specify FULL full addresses for both your service and your mex endpoint, or you need to add a base address:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="XMLService" behaviorConfiguration="MetadataBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8888/"/>
</baseAddresses>
</host>
<endpoint address="MyService"
binding="wsHttpBinding"
contract="IXMLService"/>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
http://localhost:8888/MyService, MEX http://localhost:8888/mex
, :
<service name="XMLService" behaviorConfiguration="MetadataBehavior">
<endpoint address="http://localhost:8888/MyService"
binding="wsHttpBinding"
contract="IXMLService"/>
<endpoint address="http://localhost:8888/MyService/mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>