cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Invoking windchill SOAP call from VB.NET

Saravanan
10-Marble

Invoking windchill SOAP call from VB.NET

Hello All,

We deployed a SOAP call for retrieving the ECN information.

We deployed a simple java client for invoking the SOAP call and able to retrieve the ECN information. When we attempt to retrieve the information using VB.NET, we get authorization required (401) exception. We used the same username and password credentials for both the cases.

The following WSDL url
7 REPLIES 7

Hi,


you need to autheniticate the browser:


aBaseSession.AuthenticateBrowser(userName, userPassword)

Well,


what I wrote in last email is true if you are invoking from a ProE session but if not then maybe this will be of help:


Dim myCredCache As New CredentialCache()
myCredCache.Add(New Uri("http://some.site.com"), "Basic", New NetworkCredential(userName, userPassword))
client.Credentials = myCredCache

Hello All,

We tried with C# also for invoke the web service call and find the below snippets. The VB code will be basically the same minus the semi-colons. Any help would be appreciated.

com.vce.plm.IESoapServlet t = new com.vce.plm.IESoapServlet();
string tFoo = t.jwsinterface("10-0891", ", ","wt.change2.WTChangeOrder2");

Thanks,

Hello All,

Please find the below full C# code.

com.vce.plm.IESoapServlet t = new com.vce.plm.IESoapServlet();
t.UseDefaultCredentials = true;
System.Net.NetworkCredential tCreds = (System.Net.NetworkCredential)t.Credentials;
tCreds.UserName = "ws_test";
tCreds.Password = "ws_test";
t.UseDefaultCredentials = false;
t.Credentials = tCreds;
string tFoo = t.jwsinterface("10-0891", ", ","wt.change2.WTChangeOrder2");

We get authorization required (401) exception. Any help would be appreciated.

Thanks,
jmomber
12-Amethyst
(To:Saravanan)






HttpWebRequest request = (HttpWebRequest .Create(pubMonUrl);


UTF8Encoding

request.Headers["Authorization" .ToBase64String(credentialBuffer);





// execute the request




)request.GetResponse();





~Jamie

Microsoft support site recommends two approaches for surpassing this issue.



Thank you for all your reply.

The below code works for me.

IESoapServlet tProxy = new IESoapServlet();

tProxy.PreAuthenticate = true;
tProxy.UseDefaultCredentials = false;
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add(new Uri(tProxy.Url), "Basic", new System.Net.NetworkCredential("ws_test", "ws_test", "));
tProxy.Credentials = cache;

string tFoo = tProxy.jwsinterface("10-0891", ", ", "wt.change2.WTChangeOrder2");


Thanks,
Announcements


Top Tags