Home > Back-end >  Apache CXF WSDiscoveryClient retrieval of equipment failure, can not catch caught tools?
Apache CXF WSDiscoveryClient retrieval of equipment failure, can not catch caught tools?

Time:04-17

Create a Maven project, introduce:
CXF - services - ws - discovery - API - 3.1.8. Jar,
CXF - services - ws - discovery - service - 3.1.8. Jar,
Slf4j jdk14-1.7.25 jar,
The JCL - over - slf4j - 1.7.25 jar,
Then use WSDiscoveryClient couldn't retrieve onvif device, is how to return a responsibility? Caught tools even can't catch the udp port 3702 packets,

Java code:
 public static void main (String [] args) 
{
WSDiscoveryClient client=new WSDiscoveryClient ();
Client. SetVersion10 ();
Client. SetDefaultProbeTimeout (3000);//the timeout 5 s
ProbeType ProbeType=new ProbeType ();
ProbeType. The getTypes (). The add (new QName (" TDS: Device "));
ProbeType. The getTypes (). The add (new QName (" dn: Network Video Transmitter "));//
System. The out. Println (" is the Probe: "+ client. GetAddress ());
ProbeMatchesType ProbeMatchesType=client. The probe (probeType);
List ProbeMatchTypes=probeMatchesType. GetProbeMatch ();
For (ProbeMatchType type: probeMatchTypes) {
System. The out. Println (the getXAddrs ());
}
}


Project pom. XML
 & lt; Project XMLNS="http://maven.apache.org/POM/4.0.0" XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance" 
Xsi: schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" & gt;
4.0.0 & lt;/modelVersion>

Com. Wd. Discovery
Maven - wd - discovery
0.0.1 - SNAPSHOT
Jar

Maven - wd - discovery
http://maven.apache.org


Utf-8 & lt;/project. Build. SourceEncoding>





Org. Slf4j & lt;/groupId>
Slf4j - jdk14 & lt;/artifactId>
1.7.25 & lt;/version>


Org. Slf4j & lt;/groupId>
The JCL - over - slf4j & lt;/artifactId>
1.7.25 & lt;/version>



Org, apache CXF. Services. Ws - discovery
CXF - services - ws - discovery - api
3.1.18 & lt;/version>


Org, apache CXF. Services. Ws - discovery
CXF - services - ws - discovery - service
3.1.18 & lt;/version>




Junit
Junit
3.8.1 & lt;/version>
Test






The console print information:
 the Probe: soap. Udp://239.255.255.250:3702 
September 30, 2019 2:08:14 org. In the afternoon. The apache CXF. WSDL. Service. Factory. ReflectionServiceFactoryBean buildServiceFromClass
Information: Creating Service {http://schemas.xmlsoap.org/ws/2005/04/discovery} DiscoveryProxy from class. Org. Apache CXF. Jaxws. Support. DummyImpl
September 30, 2019 2:08:18 org. In the afternoon. The apache CXF. Phase. PhaseInterceptorChain doDefaultLogging
Warning: Interceptor for DiscoveryProxy# {http://schemas.xmlsoap.org/ws/2005/04/discovery} {http://cxf.apache.org/jaxws/dispatch} Invoke has thrown exception, unwinding now
Org, apache CXF. Interceptor. Faults: Could not receive the Message.
At org, apache CXF. Interceptor. MessageSenderInterceptor $MessageSenderEndingInterceptor. HandleMessage (MessageSenderInterceptor. Java: 65)
At org, apache CXF. Phase. PhaseInterceptorChain. DoIntercept (PhaseInterceptorChain. Java: 309)
At org, apache CXF. The endpoint. ClientImpl. DoInvoke (ClientImpl. Java: 523)
At org, apache CXF. The endpoint. ClientImpl. Invoke (ClientImpl. Java: 425)
At org, apache CXF. The endpoint. ClientImpl. Invoke (ClientImpl. Java: 403)
At org, apache CXF. The endpoint. ClientImpl. InvokeWrapped (ClientImpl. Java: 396)
At org, apache CXF. Jaxws. DispatchImpl. InvokeAsync (DispatchImpl. Java: 446)
At org, apache CXF. Ws. Discovery. WSDiscoveryClient. The probe (386) WSDiscoveryClient. Java:
At org, apache CXF. Ws. Discovery. WSDiscoveryClient. The probe (353) WSDiscoveryClient. Java:
At com. Wd. Discovery. Maven_wd_discovery. App. The main (28) App. Java:
Under Caused by: java.net.SocketTimeoutException: Receive timed out
The at java.net.TwoStacksPlainDatagramSocketImpl.receive0 (Native Method)
The at java.net.TwoStacksPlainDatagramSocketImpl.receive (Unknown Source)
The at java.net.DatagramSocket.receive (Unknown Source)
At org, apache CXF. Transport. Udp. UDPConduit $UDPBroadcastOutputStream. Close (UDPConduit. Java: 325)
At org, apache CXF. Transport. AbstractConduit. Close (AbstractConduit. Java: 56)
At org, apache CXF. Transport. Udp. UDPConduit. Close (UDPConduit. Java: 144)
nullnullnullnullnullnullnull
  • Related