2012-01-03 77 views
0

我有一个使用Visual Studio 2010在Visual Basic中编写的WCF服务。我想通过SOAP从Java调用此Webservice。为了做到这一点,我让jsk的wsimport工作。现在我遇到了问题,我的Werbservice的targetNamespace被声明为“tempuri.org”,VS默认的命名空间URI。我需要知道的是,如何去改变它在Visual Studio中,我得到很好的错误尝试连接像如何更改由Visual Studio 2010生成的WSDL中的targetNamespace

Exception in thread "main" javax.xml.ws.WebServiceException: SearchService is not a valid service. Valid services are: {http://tempuri.org/}SearchService 
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source) 
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source) 
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source) 
at javax.xml.ws.Service.<init>(Unknown Source) 
at org.tempuri.SearchService.<init>(SearchService.java:42) 
at def.Call.main(Call.java:22) 

的WSDL看起来是这样的:

<wsdl:definitions name="SearchService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://xxx.de/SearchTool" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"> 

我希望你们中的一些可以找出我在这里失踪...

回答

1

我不确定自己的错误,但我被所有由Visual Studio生成的tempuri.org引用引发了疯狂。

This article可能会提供帮助,因为它列出了需要用您的方法/类来修饰您的方法/类以及它将如何影响生成的WSDL的属性。

+0

似乎非常有帮助。谢谢! 我会尝试一下,我们会看看它是否可以解决我的问题... – Maltram 2012-01-03 11:57:58

+0

现在已经使用您的链接和[很好的工具]完成了它(http://developers.de/blogs/damir_dobric/archive/2011/10/ 09 /弄平的WCF-wsdl.aspx) – Maltram 2012-01-03 13:22:01

相关问题