Author Message
Kannan
Joined: Nov 20, 2013
Messages: 17
Offline
Hi Sir,

Previously i am using axis jar to generate stub for VPMS webservice. Below is the VPMS axis based link.
http://+ vpmsHostIPAddress+/axis/services/AppIntfWS

When using this i am getting 401 unauthorized( failure authentication message) for some of the calls. Not for all calls and so planning to use webservice based on axis 2 stub.

we generated the axis2 stub with the wsdl using wsop.
https://+ vpmsHostIPAddress+/axis2/services/VPAppIntfService?wsdl

Now i have to write the client code to invoke the launch ccxml web method.

Previously in axis we have method to set the outcall username and password. But in axis2 stub don't know where to set the username and password.

Hence need click to call based on axis 2 stub sample application for reference. kindly do the needful.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Here is a code fragment that OD uses to invoke the VPAppIntfService in Axis 2. Yes the example is Axis 1.4 based.



public VPAppIntfServiceStub initConnection(String serverName, String vpWSPath, String Username, String Password,
boolean secure, TraceWriter traceWriter) throws Exception {
String webserviceCall = null;
//String webserviceURL = "/axis2/services/VPAppIntfService";
VPAppIntfServiceStub stub = null;
if (secure) {
webserviceCall = "https://" + serverName + vpWSPath;
} else {
webserviceCall = "http://" + serverName + vpWSPath;
}

traceWriter.trace(ITraceInfo.TRACE_LEVEL_DEBUG, "VPService: invoking webservice: " + webserviceCall);

try {
if (secure) {
Protocol protocolHandler = new Protocol("https", (ProtocolSocketFactory) new SSLProtocolSocketFactory1(), 443);
stub = new VPAppIntfServiceStub(webserviceCall);
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setUsername(Username);
auth.setPassword(Password);
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, protocolHandler);
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CHUNKED, "false");
traceWriter.trace(ITraceInfo.TRACE_LEVEL_DEBUG, "VPService: secure connection complete");
} else {
stub = new VPAppIntfServiceStub(webserviceCall);
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setUsername(Username);
auth.setPassword(Password);
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CHUNKED, "false");
traceWriter.trace(ITraceInfo.TRACE_LEVEL_DEBUG, "VPService: non secure connection complete");
}
} catch (Exception e) {
traceWriter.trace(ITraceInfo.TRACE_LEVEL_ERROR, "VPService: Initialization failed: " + e.getMessage());
throw e;
}
return (stub);
}

Kannan
Joined: Nov 20, 2013
Messages: 17
Offline
Hi,

Thanks for the reply.

Will you share the click to call sample applcation based on axis2 stub.

Thanks in advance.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
That does not exist. That is, that example app was never converted to Axis2.
Kannan
Joined: Nov 20, 2013
Messages: 17
Offline
Hi Sir,

I am getting 401 unauthorized while trying to invoke query resources web method.

org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized

Below is the snippet for your reference

public VPAppIntfServiceStub initializeStub(String vpmsHostIPAddress) {
log.info("initaialing the stub code");
System.out.println("initializing the stub");
VPAppIntfServiceStub stub = null;
String methodName = "[initializeStub]";
boolean secure=true;
String webServiceURL=null;
if (secure) {
webServiceURL="https://" + vpmsHostIPAddress+ "/axis2/services/VPAppIntfService";
} else {
webServiceURL="http://" + vpmsHostIPAddress+ "/axis2/services/VPAppIntfService";
}
System.out.println("Is secure web service"+secure);
String timeoutVPMS="50";
String unameVPMS="outcall";
String passwordVPMS="outcall123";
//log.info(className + methodName+ " VPMS properties are : VPMSUserName = " + unameVPMS + "; VPMSPassword = " + passwordVPMS + ";VPMSTimeout =" + timeoutVPMS);
/* locate the service */
log.info(className + methodName + " VPMS Host IP is : "+ vpmsHostIPAddress);
log.info(className + methodName + " webServiceURL : "+ webServiceURL.toString());

System.setProperty("javax.net.ssl.trustStore", "C:/Program Files/Java/jre6/lib/security/trusted_weblm_certs.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "password");
System.out.println(System.getProperty("javax.net.ssl.trustStore"));
try {
if(secure)
{
/* set parameters */
//ProtocolSocketFactory protocolSocketFactory = new SSLProtocolSocketFactory();
Protocol protocolHandler = new Protocol("https", (ProtocolSocketFactory) new SSLProtocolSocketFactory(), 443);
stub = new VPAppIntfServiceStub(webServiceURL);
Options options = stub._getServiceClient().getOptions();
System.out.println("Autenticating the service");
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setUsername(unameVPMS);
auth.setPassword(passwordVPMS);
auth.setPort(443);
options.setUserName(unameVPMS);
options.setPassword(passwordVPMS);
options.setTimeOutInMilliSeconds(10000);

options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, protocolHandler);
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION,HTTPConstants.HEADER_PROTOCOL_10);
options.setProperty(HTTPConstants.CHUNKED, "false");
stub._getServiceClient().setOptions(options);
System.out.println("Authentication completed");
log.info(className + methodName + " VPService: secure connection complete");
}
else
{
stub = new VPAppIntfServiceStub(webServiceURL);
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setUsername(unameVPMS);
auth.setPassword(passwordVPMS);
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CHUNKED, "false");
log.info(className + methodName + " VPService: secure connection complete");
}

}
catch (Exception e)
{
log.error(className + methodName + " Exception Occurred : "+ StackTraceUtil.getStackTrace(e));
}
return stub;
}

Need your assistance.

Thanks in advance.

RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
What version of OD are you using?
Kannan
Joined: Nov 20, 2013
Messages: 17
Offline
Hi Sir,

I am using OD 6.0
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Ok thanks, there it would be simpler to solve in 7.0 due to some new jars that exist.
Kannan
Joined: Nov 20, 2013
Messages: 17
Offline
Hi Sir,

kindly help me to resolve this in OD 6.0 version.

should i check anything

Thanks in advance
Kannan
Joined: Nov 20, 2013
Messages: 17
Offline
Hi Sir,

The previous error 401 unauthorized for query resources is now resolved. It seems mismatch in username and password.

Now in launch ccxml method connection refused error occurs.

org.apache.axis2.AxisFault: Connection refused: connect
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:389)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:222)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.avaya.vp.services.VPAppIntfServiceStub.launchCCXML(VPAppIntfServiceStub.java:379)
at com.cbm.js.CBM_VPWrapper.launchCCXML(CBM_VPWrapper.java:387)
at com.cbm.js.CBM_VPWrapper.main(CBM_VPWrapper.java:141)
Caused by: java.net.ConnectException: Connection refused: connect


Need your assistance.

Thanks
Kannan E
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Note the example I posted uses SSLProtocolSocketFactory1()


public class SSLProtocolSocketFactory1 implements SecureProtocolSocketFactory {

private SSLContext sslcontext = null;

public SSLProtocolSocketFactory1() {
super();
}

private SSLContext getSSLContext() {
if (sslcontext == null) {
try {
sslcontext = SSLContext.getInstance("SSL");
TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}

public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}

public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}
} };
sslcontext.init(null, trustAllCerts, null);
} catch (Exception e) {
throw new HttpClientError(e.toString());
}
}
return sslcontext;
}

public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException,
UnknownHostException {
return getSSLContext().getSocketFactory().createSocket(socket, host, port, autoClose);
}

public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException,
UnknownHostException {
return getSSLContext().getSocketFactory().createSocket(host, port, localAddress, localPort);
}

public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params)
throws IOException, UnknownHostException, ConnectTimeoutException {
if (params == null)
throw new IllegalArgumentException("Parameters may not be null");
int timeout = params.getConnectionTimeout();
SocketFactory socketfactory = getSSLContext().getSocketFactory();
if (timeout == 0)
return socketfactory.createSocket(host, port, localAddress, localPort);
else {
Socket socket = socketfactory.createSocket();
SocketAddress localaddr = new InetSocketAddress(localAddress, localPort);
SocketAddress remoteaddr = new InetSocketAddress(host, port);
socket.bind(localaddr);
socket.connect(remoteaddr, timeout);
return socket;
}
}

public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
return getSSLContext().getSocketFactory().createSocket(host, port);
}
}

RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
See attached zip. I did not do "end to end" testing but did verify the MakePartyToPartyCall does work. Please check the readme files. In run.jsp you need to alter the following:


/*
* FIX ME!! Plug in your voiceportal host name and user and password.
* Note the user and password should be an EP user with the role "WebServices".
*/
MakePartyToPartyCall call = new MakePartyToPartyCall("ClickToCall",
"myvoiceportal.sv.avaya.com", "Fred", "Flintstone");
if (call.makeCall(hostname, hostnumber, partname, partnumber) == false ) {


NOTE the comment above.
Filename ClickToCallAxis2.zip [Disk] Download
ShantalaGowda2
Joined: Nov 6, 2013
Messages: 26
Offline
We have CCXML outcall application deployed on AEP6 which has H323. We use MakePartyToPartyCall to place call in agent queue. We are passing parameter to set ANI to be displayed but its never shown on agent screen. Agent always sees IVR port# instead of value set by us. Same logic works fine on SIP setup.

Is there a way to set UUI using MakePartyToPartyCall function? Can we have documentation related to MakePartyToPartyCall?

Is there a way to set UUI in CCXML application on H323 setup?
sgowda
Joined: Dec 23, 2013
Messages: 54
Offline
For all call back requests made by customer, IVR places call to agent queue and waits till he answers call. Once answered call is connected to customer number.

Client needs customer number to be populated for screen pop. We want to either set ANI OR UUI with customer phone number so that it could be used for screen pop. We tried to set ANI but its not working on H323 endpoint setup. System uses port extension instead of what we have setup.

I was told that we cannot setup ANI on H323 setup. Is it possible to setup UUI while calling agent queue?

Any help would be appreciated.
NilasheeLiyanapathirana2
Joined: May 24, 2012
Messages: 93
Offline
Hello Ross,
Can you please upload the zip file you have attached here. It says the file has been removed.

Thanks
Go to:   
Mobile view