[
https://issues.apache.org/jira/browse/CXF-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533345
]
Jeff Yu commented on CXF-1075:
------------------------------
phew... after spending couple of hours in setting the environment, and then I
found the error is caused by the test code itself, not the CXF.
In your codes:
1. .Net wsdl service name is different from the java's, so I guess you mis-read
it.
<wsdl:service name="Service">
<wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
<soap:address location="http://10.129.9.196/hw/service.asmx" />
</wsdl:port>
<wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
<soap12:address location="http://10.129.9.196/hw/service.asmx" />
</wsdl:port>
</wsdl:service>
Pay attention to the port name, it is "ServiceSoap", instead of "SoapService".
2. I don't know whether you are using the CXF's wsdl2java tool to generate the
stub, but if you used the tool, as I did. ( I am using the cxf-2.0.2, but I am
guessing cxf-2.0 did the same thing). You will find
The generated code called: Service.java, ServiceSoap.java
So look at the cxf client that you used, It definitely uses the wrong class, I
am guess.
Below is the code that I am testing, and it works great: (Rename the
Service.java to TheSOAPService for not confusing).
TheSOAPService soapService = new TheSOAPService();
ServiceSoap service = soapService.getServiceSoap();
String resp;
System.out.println("Invoking greetMe...");
resp = service.greetMe("This is big mistake");
System.out.println("Server responded with: " + resp);
System.out.println();
> Interoperability Issue - CXF based client unable to access .Net based Service
> -----------------------------------------------------------------------------
>
> Key: CXF-1075
> URL: https://issues.apache.org/jira/browse/CXF-1075
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0
> Environment: Windows XP, JDK 1.5 and .net 2005
> Reporter: Lalit Dilip Markande
> Attachments: helloworld.zip
>
>
> When xfire java client is used with xfire java server, its working fine. But
> getting error while accessing .net server with xfire java client.
> Error message is :
> http://localhost/HelloWorld/service.asmx?wsdl
> Exception in thread "main" javax.xml.ws.WebServiceException:
> org.apache.cxf.service.factory.ServiceConstructionException: Could Could not
> find definition for service
> {http://apache.org/hello_world_soap_http}SOAPService.
> at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:103)
> at
> org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:55)
> at javax.xml.ws.Service.<init>(Service.java:57)
> at
> org.apache.hello_world_soap_http.SOAPService.<init>(SOAPService.java:37)
> at demo.hw.client.Client.main(Client.java:28)
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Could not find definition for service
> {http://apache.org/hello_world_soap_http}SOAPService.
> at
> org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:114)
> at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:110)
> at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:101)
> ... 4 more
> Java Result: 1
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.