POST /axl/ HTTP/1.0
Host:192.168.100.38:8443
Authorization: Basic abCDefgHiJkLmnOpqrst
Accept: text/*
Content-type: text/xml
SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
Content-length: 1124
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap="http://schemas.cisco.com/ast/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header>
<AstHeader xsi:type="soap:AstHeader">
<SessionId xsi:type="xsd:string"/>
</AstHeader>
</soapenv:Header>
<soapenv:Body>
<soap:SelectCmDevice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<CmSelectionCriteria xsi:type="soap:CmSelectionCriteria">
<MaxReturnedDevices xsi:type="xsd:unsignedInt">200</MaxReturnedDevices>
<Class xsi:type="xsd:string">Any</Class>
<Model xsi:type="xsd:unsignedInt">255</Model>
<Status xsi:type="xsd:string">Any</Status>
<SelectBy xsi:type="xsd:string">Name</SelectBy>
<SelectItems soapenc:arrayType="soap:SelectItem[1]" xsi:type="soapenc:Array">
<item xsi:type="soap:SelectItem">
<Item xsi:type="xsd:string">SEP00123456789A</Item>
</item>
</SelectItems>
</CmSelectionCriteria>
</soap:SelectCmDevice>
</soapenv:Body>
</soapenv:Envelope>
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONIDSSO=DE668BC04C25C984103B0EFFF0F639BA; Path=/
Set-Cookie: JSESSIONID=39BFF0D5F7E4B416939E050CC7D23152; Path=/axl; Secure
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Content-Length: 552
Date: Wed, 27 Aug 2008 11:16:21 GMT
Connection: close
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Handler found for SelectCmDevice</faultstring>
<detail>
<axl:Error xmlns:axl="http://www.cisco.com/AXL/API/1.0">
<axl:code>5003</axl:code>
<axl:message>No Handler found for SelectCmDevice</axl:message>
<request>SelectCmDevice</request>
</axl:Error>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /realtimeservice/services/RisPort HTTP/1.0
Host: <serverip>:8443
Authorization: Basic <base64 encoded user:pass>
Accept: text/*
Content-type: text/xml
SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
Content-length: <length of request>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header>
<AstHeader xsi:type="soap:AstHeader">
<SessionId xsi:type="xsd:string" />
</AstHeader>
</soapenv:Header>
<soapenv:Body>
<soap:SelectCmDevice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<CmSelectionCriteria xsi:type="soap:CmSelectionCriteria">
<MaxReturnedDevices xsi:type="xsd:unsignedInt">200</MaxReturnedDevices>
<Class xsi:type="xsd:string">Any</Class>
<Model xsi:type="xsd:unsignedInt">255</Model>
<Status xsi:type="xsd:string">Any</Status>
<SelectBy xsi:type="xsd:string">Name</SelectBy>
<SelectItems soapenc:arrayType="soap:SelectItem[1]" xsi:type="soapenc:Array">
<item xsi:type="soap:SelectItem">
<Item xsi:type="xsd:string"></Item>
</item>
</SelectItems>
</CmSelectionCriteria>
</soap:SelectCmDevice>
</soapenv:Body>
</soapenv:Envelope>
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
public class CiscoRealtime {
public static void main(String[] args) {
byte[] bArray = null; // buffer for reading response from
Socket socket = null; // socket to AXL server
OutputStream out = null; // output stream to server
InputStream in = null; // input stream from server
String sRealtimeSOAPRequest = ""; // HTTPS header and SOAP payload
String sRealtimeRequest = null; // will hold only the SOAP payload
//CCMAdministrator and password
String authorization = "Admin" + ":" + "Admin";
// base64 encoding of the username and password
authorization = new sun.misc.BASE64Encoder().encode(authorization.getBytes());
// Cisco Realtime Header
sRealtimeSOAPRequest = "POST /realtimeservice/services/RisPort HTTP/1.0\r\n" +
"Host: 192.168.2.2:8443\r\n" +
"Authorization: Basic " + authorization + "\r\n" +
"Accept: text/*\r\n" +
"Content-type: text/xml\r\n" +
"SOAPAction: \"http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice\"\r\n" +
"Content-length: ";
// Cisco Realtime Request (aktuelle IPs)
sRealtimeRequest = "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap=\"http://schemas.cisco.com/ast/soap/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
" <soapenv:Header>" +
" <AstHeader xsi:type=\"soap:AstHeader\">" +
" <SessionId xsi:type=\"xsd:string\"/>" +
" </AstHeader>" +
" </soapenv:Header>" +
" <soapenv:Body>" +
" <soap:SelectCmDevice soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
" <CmSelectionCriteria xsi:type=\"soap:CmSelectionCriteria\">" +
" <MaxReturnedDevices xsi:type=\"xsd:unsignedInt\">200</MaxReturnedDevices>" +
" <Class xsi:type=\"xsd:string\">Any</Class>" +
" <Model xsi:type=\"xsd:unsignedInt\">255</Model>" +
" <Status xsi:type=\"xsd:string\">Any</Status>" +
" <SelectBy xsi:type=\"xsd:string\">Name</SelectBy>" +
" <SelectItems soapenc:arrayType=\"soap:SelectItem[1]\" xsi:type=\"soapenc:Array\">" +
" <item xsi:type=\"soap:SelectItem\">" +
" <Item xsi:type=\"xsd:string\"></Item>" +
" </item>" +
" </SelectItems>" +
" </CmSelectionCriteria>" +
" </soap:SelectCmDevice>" +
" </soapenv:Body>" +
"</soapenv:Envelope>";
// finish the HTTPS Header
sRealtimeSOAPRequest += sRealtimeRequest.length();
sRealtimeSOAPRequest += "\r\n\r\n";
// now add the SOAP payload to the HTTPS header, which completes the AXL
// SOAP request
sRealtimeSOAPRequest += sRealtimeRequest;
try {
CiscoRealtime mycr = new CiscoRealtime();
// Implement the certificate-related stuffs required for sending request via https
X509TrustManager xtm = mycr.new MyTrustManager();
TrustManager[] mytm = { xtm };
SSLContext ctx = SSLContext.getInstance("SSL");
ctx.init(null, mytm, null);
SSLSocketFactory sslFact = (SSLSocketFactory) ctx.getSocketFactory();
socket = (SSLSocket) sslFact.createSocket("192.168.2.2", Integer.parseInt("8443"));
in = socket.getInputStream();
// send the request to the server
// read the response from the server
StringBuffer sb = new StringBuffer(2048);
bArray = new byte[2048];
int ch = 0;
int sum = 0;
out = socket.getOutputStream();
out.write(sRealtimeSOAPRequest.getBytes());
while ((ch = in.read(bArray)) != -1) {
sum += ch;
sb.append(new String(bArray, 0, ch));
}
socket.close();
// output the response to the standard output
System.out.println(sb.toString());
} catch (UnknownHostException e) {
System.err.println("Error connecting to host: " + e.getMessage());
return;
} catch (IOException ioe) {
System.err.println("Error sending/receiving from server: " + ioe.getMessage());
// close the socket
} catch (Exception ea) {
System.err.println("Unknown exception " + ea.getMessage());
return;
}
finally{
try {
if (socket != null)
socket.close();
} catch (Exception exc) {
exc.printStackTrace();
System.err.println("Error closing connection to server: "+ exc.getMessage());
}
}
}
public class MyTrustManager implements X509TrustManager {
MyTrustManager() {
// create/load keystore
}
public void checkClientTrusted(X509Certificate chain[], String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate chain[], String authType) throws CertificateException {
}
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}
}
Kann mir hier jemand einen Tip geben wie ich an der Stelle weiter komme?Fehler beim Reflektieren des Typs 'AXLSQL.APIRequest'
select NumPlan.DNOrPattern as DirectoryNumber, Device.Name as DeviceName, Device.Description as
UserDeviceProfileName, Device.LoginUserid as UserId, DeviceNumPlanMap.Display as
DisplayIntCallerID,DeviceNumPlanMap.Label as LineTextLabel,numplan.alertingname as
AlertingName,DeviceNumPlanMap.MaxNumCalls, DeviceNumPlanMap.BusyTrigger,
TypeModel.Name AS PhoneType, DeviceNumPlanMap.E164Mask as ExtPhoneMask, NumPlan.CFADestination as
CallFWDALL, NumPlan.CFNADestination as CallFWDNoAnswer, NumPlan.CFBDestination as CallFWDBusy,
devicepool.Name as DevPoolName
from numplan, devicenumplanmap, devicepool, device ,TypeModel
where DeviceNumPlanMap.fknumplan = numplan.pkid
and DeviceNumPlanMap.fkdevice = device.pkid
and device.fkdevicepool = devicepool.pkid
and TypeModel.Name = 'Cisco 7970'
and numplan.tkPatternUsage = 2
order by numplan.DnOrPattern
SELECT * from device WHERE name = 'SEP000F34D6FBEF'
numplan.tkPatternUsage = 2
select DNOrPattern,CFaDestination,CFBDestination,CFnaDestination from NumPlan where DNOrPattern like '5%' and
CFADestination like '[0-9]%' order by DNOrPattern
select DNOrPattern,CFADestination from NumPlan where (CFAVoicemailEnabled = 1) order by DNOrPattern
select DNOrPattern,PrefixDigitsOut,Description from NumPlan where DNOrPattern like '5%.' order by DNOrPattern
SELECT Device.Name, NumPlan.DNOrPattern, DeviceNumPlanMap.Display,
DeviceNumPlanMap.MaxNumCalls, DeviceNumPlanMap.BusyTrigger,
TypeModel.Name AS Expr1, DeviceNumPlanMap.NumPlanIndex
FROM DeviceNumPlanMap INNER JOIN
NumPlan ON DeviceNumPlanMap.fkNumPlan = NumPlan.pkid INNER JOIN
Device ON DeviceNumPlanMap.fkDevice = Device.pkid INNER JOIN
TypeModel ON Device.tkModel = TypeModel.Enum
WHERE (DeviceNumPlanMap.MaxNumCalls = '4') AND (TypeModel.Name = 'Cisco 7970') order by DNOrPattern