Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Im working developing a Web Application who consumes MDS Web Service using C#; this Web Service is hosted in Server A using IIS. This Web App run perfectly when I'm working on local mode, I make request and the MDS Web Services response without problem. But, when I publish my Web app on another Server using IIS(Server B) I don´t have response from Web Service.

On Server B windows authentication is enabled for the Site where my App Web is hosted.

Server A, Server B and my machine belong to the same Intranet.

What I have tried:

This is my code in C#, with bindings and connections:

C#
private static ServiceClient createMdsProxy(string mdsURL)  /
    {

        EndpointAddress pntFinalAddress = new EndpointAddress(new Uri(mdsURL), EndpointIdentity.CreateUpnIdentity("@etnas.conts.net"));
        WSHttpBinding wsBinding = new WSHttpBinding();
        wsBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
        wsBinding.Security.Mode = SecurityMode.Message;

        wsBinding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
        wsBinding.Security.Message.NegotiateServiceCredential = true;           
        wsBinding.Security.Message.EstablishSecurityContext = true;

        wsBinding.MaxReceivedMessageSize = 2147483646;
        wsBinding.MaxBufferPoolSize = 2147483646;


        return new ServiceClient(wsBinding, pntFinalAddress);
    }


Within other method I call createMdsProxy method:
mdsproxy = createMdsProxy("http://arwdw20.etnas.conts.net:8001/service/Service.svc");
mdsProxy.ClientCredentials.Windows.ClientCredential.UserName = System.Threading.Thread.CurrentPrincipal.Identity.Name;

//.
//.Code to make the request using MDS Web Service Methods.
//.
EntityMembersGetResponse getResponse = mdsProxy.EntityMembersGet(getRequest);// Get the entity member information


The next code is Web.config Im using on client side.
<configuration>  <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
  </basicHttpBinding>
  <wsHttpBinding>
    <binding name="WSHttpBinding_IService"/>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://arwdw20.etnas.conts.net:8001/service/Service.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService" contract="IService" name="WSHttpBinding_IService">
    <identity>
      <userPrincipalName value="DSSService@itnes.conts.net"/>
    </identity>
  </endpoint>
  <endpoint address="http://arwdw20.etnas.conts.net:8001/service/Service.svc/bhb" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="IService" name="BasicHttpBinding_IService"/>
</client>  </system.serviceModel>  <system.web>    <compilation debug="true"/>  </system.web></configuration>


And This one is part of WSDL FILE from MDS Web Service:
XML
<wsdl:service name="Service">
     <wsdl:port name="WSHttpBinding_IService" binding="tns:WSHttpBinding_IService">
          <soap12:address location="http://arwdw20.etnas.conts.net:8001/service/Service.svc" /> 
          <wsa10:EndpointReference>
            <wsa10:Address>http://arwdw20.etnas.conts.net:8001/service/Service.svc</wsa10:Address> 
               <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
                  <Upn>DSSService@itnes.conts.net</Upn> 
               </Identity>
          </wsa10:EndpointReference>
     </wsdl:port>
     <wsdl:port name="BasicHttpBinding_IService" binding="tns:BasicHttpBinding_IService">
         <soap:address location="http://arwdw20.etnas.conts.net:8001/service/Service.svc/bhb" /> 
     </wsdl:port>
</wsdl:service>



I hope you can help me to solve this issue.
Thank you so much!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900