我正在尝试为用户请求在特定房间中开会。通过下面的SOAP请求,我看到一个临时日历事件出现在用户的日历中,但会议室日历上什么都没有显示。我如何才能将会议请求发送到资源室?我的目标是根据会议室的可用性,使会议室自动回复会议请求者。是接受会议还是拒绝会议。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/messages">
<SOAP-ENV:Header>
<ns1:RequestServerVersion Version="Exchange2007"/>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:CreateItem SendMeetingInvitations="SendToAllAndSaveCopy">
<ns2:Items>
<ns1:CalendarItem>
<ns1:ItemClass>IPM.Appointment</ns1:ItemClass>
<ns1:Subject>Test Meeting</ns1:Subject>
<ns1:Sensitivity>Normal</ns1:Sensitivity>
<ns1:Importance>Normal</ns1:Importance>
<ns1:Start>2018-12-29T06:00:00+00:00</ns1:Start>
<ns1:End>2018-12-29T06:30:00+00:00</ns1:End>
<ns1:RequiredAttendees>
<ns1:Attendee>
<ns1:Mailbox>
<ns1:Name>Bob Joe</ns1:Name>
<ns1:EmailAddress>sampleUser@website.com</ns1:EmailAddress>
<ns1:RoutingType>SMTP</ns1:RoutingType>
</ns1:Mailbox>
</ns1:Attendee>
</ns1:RequiredAttendees>
<ns1:Resources>
<ns1:Attendee>
<ns1:Mailbox>
<ns1:EmailAddress>sampleRoomEmail@website.com</ns1:EmailAddress>
<ns1:RoutingType>SMTP</ns1:RoutingType>
</ns1:Mailbox>
</ns1:Attendee>
</ns1:Resources>
</ns1:CalendarItem>
</ns2:Items>
</ns2:CreateItem>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
答案 0 :(得分:0)
您可以使用EWS Manage API,请参考以下代码:
public class ParkourApp extends Application {
private List<Point2D> points = new ArrayList<>();
private List<Circle> circles = new ArrayList<>();
private Player p1;
public Parent createContent (){
BorderPane root = new BorderPane();
Pane draw = new Pane();
Circle c1 = new Circle(100,0,5);
Circle c2 = new Circle(200,0,5);
Circle c3 = new Circle(300,0,5);
Circle c4 = new Circle(400,0,5);
Circle c5 = new Circle(0,100,5);
Circle c6 = new Circle(0,200,5);
Circle c7 = new Circle(0,300,5);
Circle c8 = new Circle(0,400,5);
addVerticalStraight(100,100,100,50,6);
addHorizontalStraight(150,50,100,50,6);
addVerticalStraight(140,250,50,50,6);
addVerticalStraight(300,150,100,50,6);
addStraight(100,90,140,50,9);
addStraight(100,210,135,250,8);
addStraight(158,205,190,240,8);
addStraight(260,50,330,80,9);
addStraight(340,85,350,140,8);
addStraight(258,105,300,140,8);
addAllCircles();
AnimationTimer at = new AnimationTimer() {
@Override
public void handle(long now) {
update();
}
};
at.start();
for(Circle c : circles){
draw.getChildren().add(c);
}
p1 = new Player(new Rectangle(50,400,11,5));
p1.setGeschwindigkeit(new Point2D(1,0));
System.out.printf("xx:%f YY:%f\n",p1.getNode().getTranslateX(),p1.getNode().getTranslateY());
draw.getChildren().addAll(c1,c2,c3,c4,c5,c6,c7,c8,p1.getNode());
root.setCenter(draw);
return root;
}
private void update(){
for(Circle c : circles){
if(p1.isColliding(c)){
System.out.println("is Colliding..");
}
}
p1.update();
}
private void addAllCircles(){
for(Point2D po : points){
Circle c = new Circle(po.getX(),po.getY(),3, Color.DIMGREY);
circles.add(c);
}
}
private ArrayList<Point2D> addStraight(double startX, double startY, double endX, double endY, double divisor){
ArrayList<Point2D> list = new ArrayList<>();
double length = 0;
double xDist = 0;
double m = 0;
if(startX != endX) {
if(endX < startX){
double temp = startX;
startX = endX;
endX = temp;
temp = startY;
startY = endY;
endY = temp;
}
//upgrade of the straight
m = -(startY-endY)/(endX - startX);
System.out.println(m);
//Distance of the two points
length = Math.sqrt(Math.pow(endX - startX, 2) + Math.pow(endY - startY, 2));
System.out.println(length);
//xDist is the distance of every point of the straight on the x-axis
xDist = endX - startX;
xDist /= divisor;
System.out.println(xDist);
double x = startX;
double y = startY;
//this loop uses all the data that was calculated and creates a
//2D-Point which is stored in class-list of the circles
for(int i=0; i<divisor+1; i++){
list.add(new Point2D(x, y));
points.add(new Point2D(x, y));
y += (xDist * m);
System.out.println(y);
x += xDist;
}
}
return list;
}
private ArrayList<Point2D> addHorizontalStraight(double x, double y, double length, double width, double dist){
int amount = (int)length/(int)dist;
ArrayList<Point2D> list = new ArrayList<>();
for(int i=0; i<amount+1; i++){
list.add(new Point2D(x,y));
list.add(new Point2D(x,y+width));
points.add(new Point2D(x,y));
points.add(new Point2D(x,y+width));
x += dist;
}
return list;
}
private ArrayList<Point2D> addVerticalStraight(double x, double y, double length, double width, double dist){
int amount = (int)length/(int)dist;
ArrayList<Point2D> list = new ArrayList<>();
for(int i=0; i<amount+1; i++){
list.add(new Point2D(x,y));
list.add(new Point2D(x+width,y));
points.add(new Point2D(x,y));
points.add(new Point2D(x+width,y));
y += dist;
}
return list;
}
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setScene(new Scene(createContent(),600,600));
primaryStage.getScene().setOnKeyReleased(e ->{
switch (e.getCode()){
case LEFT:
p1.turnLeft();
break;
case RIGHT:
p1.turnRight();
break;
case UP:
p1.faster();
break;
case DOWN:
p1.slower();
break;
}
});
primaryStage.show();
}
有关更多信息,请参阅以下链接:
Get all appointments from a resource(room) in Exchange Online(2010) with EWS