Quantcast
Channel: SQL Server Master Data Services forum
Viewing all articles
Browse latest Browse all 1311

Calling Master Data webservices API from Web application Client

$
0
0

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:

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:

<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!


Viewing all articles
Browse latest Browse all 1311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>