Skip to Content
Former Member
Nov 11, 2010 at 06:16 AM

Consume the webservice in PI Box


Dear Experts,

I have created a Java Class that calls a webservice deployed in PI 7.1. Below is the java code

private String sendingDataToPISystem(String userName, String password, String endPointReference, String nameSpace, String serviceName, String localPart, Object inputData)


String returnValue = null;



QName serviceQName = new QName(nameSpace, serviceName);

QName portQName = new QName(nameSpace, localPart);

Service service = Service.create(new URL(endPointReference), serviceQName);

Map map = ((BindingProvider)service.getPort(portQName, serviceQName.getClass())).getRequestContext();

map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPointReference);

map.put(BindingProvider.USERNAME_PROPERTY, userName);

map.put(BindingProvider.PASSWORD_PROPERTY, password);

service.addPort(portQName, HTTPBinding.HTTP_BINDING, new URI(endPointReference).toString());

Dispatch<Object> dispatch = service.createDispatch(portQName, Object.class, Service.Mode.PAYLOAD);


returnValue = "SUCCESS";

}catch(Exception exception)


returnValue = "FAILURE";




return returnValue;



This code is not throwing any error but at the same time unable to make a call to webservice in PI box

Note: I am using NWDS CE 7.1 SP 10PAT0001

Please Advice what should be done, inorder to make my Java class work.