I am stuck in this problem where I have to connect to Teamcenter (TC14) with HTTPS endpoint URL using WSDLs manually provided as files (because they are not exposed anymore). Trying them in browser will show:-
<soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Text xml:lang="en-US">The endpoint reference (EPR) for the Operation not found is /tc/services/Core-2006-03-Session and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</soapenv:Text>
</soapenv:Reason>
The code for the login is provided below:-
public class TeamcenterConnectionService
{
public TeamcenterConnectionService(string sessionURL, string userId, string password)
{
this.session = new Core0603SessionClient();
session.Endpoint.Address = new EndpointAddress(sessionURL);
LoginResponse loginResponse = login(userId, password);
}
public LoginResponse login(string userId, string password)
{
LoginInput loginInput = new LoginInput();
loginInput.username = userId;
loginInput.password = password;
loginInput.sessionDiscriminator = RandomString(14);
LoginResponse loginResponse = null;
try
{
loginResponse = session.login(loginInput);
return loginResponse;
}
catch (Exception ex)
{
throw ex;
}
}
}
Here, sessionURL is the HTTPS url (Dummy url that is similar to original:-https://abctc14qwertyu.test.com:6969/tc/services/Core-2006-03-Session) that I am supposed to use for login.
In web.config, I have set the binding as below for now:-
binding name="Core0603SessionSoapBinding" maxBufferPoolSize="20000000" maxBufferSize="20000000" maxReceivedMessageSize="20000000" >
<security mode="TransportWithMessageCredential" >
</security>
I have tried all different security modes and getting different errors:-
For security mode = "None" and "TransportCredentialOnly", I get error:- "The provided URI scheme 'https' is invalid; expected 'http'.Parameter name: via"
For security mode = "Transport", I get error:- "An error occurred in the presentation tier. %"
For security mode = "TransportWithMessageCredential", I get error:- "The username is not provided. Specify username in ClientCredentials."
Not to be used here but just for reference:-
For security mode = "Message", I get error:- "BasicHttp binding requires that BasicHttpBinding.Security.Message.ClientCredentialType be equivalent to the BasicHttpMessageCredentialType.Certificate credential type for secure messages. Select Transport or TransportWithMessageCredential security for UserName credentials."
What should I do to make this work?
NOTE:-
-
The HTTPS url is being used by another team ensuring that the URL is up and running.
-
session.ClientCredentials is readonly, so unable to add username or password while using “TransportWithMessageCredential”.
-
This code with security mode = “None” works for HTTP TC11 URL (same WSDL). Is the WSDL not configured to work for HTTPS?