有人可以向像我这样的Boost初学者解释什么是属性地图是在Boost?在尝试使用BGL计算强连接组件时,我遇到了这个问题.我去了属性地图和图形模块的文档,但仍然不知道该怎么做.以此代码为例: - make_iterator_property_map函数在做什么? - 这段代码的含义是什么:get(vertex_index,G)?
#include <boost/config.hpp>
#include <vector>
#include <iostream>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/adjacency_list.hpp>
int
main()
{
using namespace boost;
typedef adjacency_list < vecS, vecS, directedS > Graph;
const int N = 6;
Graph G(N);
add_edge(0, 1, G);
add_edge(1, 1, G);
add_edge(1, 3, G);
add_edge(1, 4, G);
add_edge(3, 4, G);
add_edge(3, 0, G);
add_edge(4, 3, G);
add_edge(5, 2, G);
std::vector<int> c(N);
int num = strong_components
(G, make_iterator_property_map(c.begin(), get(vertex_index, G), c[0]));
std::cout << "Total number of components: " << num …Run Code Online (Sandbox Code Playgroud) 如何强制SOAP Axis客户端使用TLS而不是SSL?我有以下代码:
SOAPMessage soapMessage = MessageFactory.newInstance()
.createMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
javax.xml.soap.SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationStyle(org.apache.axis.constants.Style.DOCUMENT);
call.setSOAPActionURI("urn:processDocument");
call.setUsername(user);
call.setPassword(password);
call.setTimeout(10000);
call.invoke(new Message(soapEnvelope.toString()));
Run Code Online (Sandbox Code Playgroud)
执行时的错误是:
javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:1870)
at TestTLSConnect.main(TestTLSConnect.java:100)
Run Code Online (Sandbox Code Playgroud)
我也激活了SSL日志记录,可以看到以下内容:
main, WRITE: SSLv3 Handshake, length = 79
main, READ: TLSv1 Alert, length = 2
main, RECV TLSv1 ALERT: fatal, …Run Code Online (Sandbox Code Playgroud)