Cisco Cisco Prime Central 1.5 Developer's Guide
Appendix II – 3GPP-Miscellaneous
Cisco Prime OSS Integration Guide for MTOSI and 3GPP
OL-31029-01
215
11.7 Useful Code Snippets for 3GPP
This section has sample code snippets to retrieve the inventory using 3GPP interface.
11.7.1 Useful Code Snippets for 3GPP Request Response
This section provides code snippets that can be used by a SOAP client to communicate with
the 3GPP Web Service to perform the required operation.
the 3GPP Web Service to perform the required operation.
// Java SOAP client Imports
package com.mt.mysoap;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Observable;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;
import javax.net.ssl.X509TrustManager;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
public class StandAloneSoapClient extends Observable {
private boolean debug = false;
public void runClient(String wsdlname, String username, String
password, String operation, String queryParams) {
package com.mt.mysoap;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Observable;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;
import javax.net.ssl.X509TrustManager;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
public class StandAloneSoapClient extends Observable {
private boolean debug = false;
public void runClient(String wsdlname, String username, String
password, String operation, String queryParams) {
SOAPConnection connection = null;
try {
HostnameVerifier hv = new HostnameVerifier() {