Hi Dan,
Hi Community,
I try to discover a wcf service with cxf.
This service is written with .net and can discover from a .net program. I
also can reach it directly from a java program.
But if I try to discover it with WSDiscoverClient I will get an exception at
running the probe method.
The exception is thrown by WSDiscoveryClient.class from "public
ProbeMatchesType probe(ProbeType params, int timeout)" (here from
"AsyncHandler<Object> handler = new AsyncHandler<Object>()").
I search for days for a solution but found nothing. I saw that many people
got this problem but cant recognize any solution. L
So I hope you can help me.
My programming:
public final static QName SERVICE = new
QName("http://XYZService.de","XYZService");
public static void main(String[] args) throws Exception
WSDiscoveryClient client = new WSDiscoveryClient();
client.setDefaultProbeTimeout(1000);
List<EndpointReference> references = client.probe(SERVICE);
Here the info from my direct call of the service. It seams that the QName is
correct:
2404 [main] INFO org.apache.cxf.service.factory.ReflectionServiceFactoryBean
- Creating Service {http://XYZService.de}XYZService from WSDL:
http://xxx-msi:8080/XYZ?Wsdl
My exception:
5836 [main] INFO org.apache.cxf.service.factory.ReflectionServiceFactoryBean
- Creating Service
{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy from
class org.apache.cxf.jaxws.support.DummyImpl
7443 [main] WARN org.apache.cxf.phase.PhaseInterceptorChain - Interceptor
for
{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy#{http:
//cxf.apache.org/jaxws/dispatch}Invoke has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInter
ceptor.handleMessage(MessageSenderInterceptor.java:64)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain
.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:450)
at
org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:443)
at
org.apache.cxf.jaxws.DispatchImpl.invokeAsync(DispatchImpl.java:432)
at
org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:3
79)
at
org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:3
28)
at de.medhqservice.WSDiscovery.main(WSDiscovery.java:27)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.TwoStacksPlainDatagramSocketImpl.receive0(Native Method)
at
java.net.TwoStacksPlainDatagramSocketImpl.receive(TwoStacksPlainDatagramSock
etImpl.java:114)
at java.net.DatagramSocket.receive(DatagramSocket.java:781)
at
org.apache.cxf.transport.udp.UDPConduit$UDPBroadcastOutputStream.close(UDPCo
nduit.java:308)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.udp.UDPConduit.close(UDPConduit.java:137)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInter
ceptor.handleMessage(MessageSenderInterceptor.java:62)
... 9 more
My POM(a part of it):
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>de.medhq.WSDiscovery</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>src/main/generated/de/medhqservice/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.10</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/generated</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>http://magnat-msi:8080/MedHQ?Wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>MedHQServiceClient</finalName>
</build>
<properties>
<cxf.version>2.7.11</cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-aegis</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-http</artifactId>
<version>2.5.11</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-local</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-jms</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-management</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-common-schemas</artifactId>
<version>2.3.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf.services.ws-discovery</groupId>
<artifactId>cxf-services-ws-discovery-api</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf.services.ws-discovery</groupId>
<artifactId>cxf-services-ws-discovery-service</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxp-api</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
</project>
Hi Community,
I try to discover a wcf service with cxf.
This service is written with .net and can discover from a .net program. I
also can reach it directly from a java program.
But if I try to discover it with WSDiscoverClient I will get an exception at
running the probe method.
The exception is thrown by WSDiscoveryClient.class from "public
ProbeMatchesType probe(ProbeType params, int timeout)" (here from
"AsyncHandler<Object> handler = new AsyncHandler<Object>()").
I search for days for a solution but found nothing. I saw that many people
got this problem but cant recognize any solution. L
So I hope you can help me.
My programming:
public final static QName SERVICE = new
QName("http://XYZService.de","XYZService");
public static void main(String[] args) throws Exception
WSDiscoveryClient client = new WSDiscoveryClient();
client.setDefaultProbeTimeout(1000);
List<EndpointReference> references = client.probe(SERVICE);
Here the info from my direct call of the service. It seams that the QName is
correct:
2404 [main] INFO org.apache.cxf.service.factory.ReflectionServiceFactoryBean
- Creating Service {http://XYZService.de}XYZService from WSDL:
http://xxx-msi:8080/XYZ?Wsdl
My exception:
5836 [main] INFO org.apache.cxf.service.factory.ReflectionServiceFactoryBean
- Creating Service
{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy from
class org.apache.cxf.jaxws.support.DummyImpl
7443 [main] WARN org.apache.cxf.phase.PhaseInterceptorChain - Interceptor
for
{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy#{http:
//cxf.apache.org/jaxws/dispatch}Invoke has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInter
ceptor.handleMessage(MessageSenderInterceptor.java:64)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain
.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:450)
at
org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:443)
at
org.apache.cxf.jaxws.DispatchImpl.invokeAsync(DispatchImpl.java:432)
at
org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:3
79)
at
org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:3
28)
at de.medhqservice.WSDiscovery.main(WSDiscovery.java:27)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.TwoStacksPlainDatagramSocketImpl.receive0(Native Method)
at
java.net.TwoStacksPlainDatagramSocketImpl.receive(TwoStacksPlainDatagramSock
etImpl.java:114)
at java.net.DatagramSocket.receive(DatagramSocket.java:781)
at
org.apache.cxf.transport.udp.UDPConduit$UDPBroadcastOutputStream.close(UDPCo
nduit.java:308)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.udp.UDPConduit.close(UDPConduit.java:137)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInter
ceptor.handleMessage(MessageSenderInterceptor.java:62)
... 9 more
My POM(a part of it):
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>de.medhq.WSDiscovery</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>src/main/generated/de/medhqservice/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.10</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/generated</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>http://magnat-msi:8080/MedHQ?Wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>MedHQServiceClient</finalName>
</build>
<properties>
<cxf.version>2.7.11</cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-aegis</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-http</artifactId>
<version>2.5.11</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-local</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-jms</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-management</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-common-schemas</artifactId>
<version>2.3.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf.services.ws-discovery</groupId>
<artifactId>cxf-services-ws-discovery-api</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf.services.ws-discovery</groupId>
<artifactId>cxf-services-ws-discovery-service</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxp-api</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
</project>