Skip to main content
1-Visitor
May 28, 2012
Question

Calling a .Net webservice from Windchill code.

  • May 28, 2012
  • 2 replies
  • 825 views

Hi All,


I have a requirement where I would need to consume a weservice available from Windchill code. Anybody has experience on doing something similar. Any documentation avaialble on these topics.


Any help is appreciated.


Praseeth M

2 replies

10-Marble
May 29, 2012

Yes, we do this all the time. You can use the Apache Axis package, which is actually already included in the Windchill codebase. Here is some sample code.. provided without warranty of any kind, of course. 🙂


import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.*;
.
.
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName(uri, webmethod));
call.setSOAPActionURI(uri+webmethod);
for (int i = 0; i < argNames.length; i++)
call.addParameter(argNames[i],argTypes[i],javax.xml.rpc.ParameterMode.IN);
if (returnType != null)
call.setReturnType(returnType);
o = call.invoke( args );


Hope this helps...


-Charlie

1-Visitor
May 29, 2012
Thanks Charles. That was a lot of help. Will try that !!!

Praseeth M