看到Java Web服务和与其通信的.NET客户端之间有些奇怪的事情。我们正在来回发送带有DateTime属性的对象。像这样(从WSDL生成):
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://ournamespace.com/")]
public partial class myClass {
private System.DateTime expirationDateField;
private string nameField;
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public System.DateTime expirationDate {
get {
return this.expirationDateField;
}
set {
this.expirationDateField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string name {
get {
return this.nameField;
}
set {
this.nameField = value;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我们收到的对象的日期很好,但是当我们将它们发送回Web服务时,该expirationDate属性显示为null。我们查看了Java服务器正在接收的原始XML,并且该XML的标签expirationDate不存在,就像这样:
<myClass><name>My Name</name></myClass>
Run Code Online (Sandbox Code Playgroud)
(这不是确切的XML,但足够接近)。我经过仔细检查,expirationDate并确定在发送之前在.NET客户端上进行了设置。WSDL的XSD看起来并不奇怪:
<xs:element name="Expiration" type="xs:dateTime" minOccurs="0"/>
Run Code Online (Sandbox Code Playgroud)
我们在其他事情上使用相同的类型,也可以正常工作。在.NET方面,我们正在使用该wsdl.exe工具生成类和代码。
我们可以采取的另一步骤是在调用Web服务之前查看.NET生成的XML,但我不知道该怎么做。还有其他想法或建议吗?
问题背景
这是情况.我们正在从战争中运行模拟器servlet.我们正在模拟的servlet在一台机器上有许多实例,这些实例由端口号区分.我们只想部署一个可以被许多端口访问的单一战争.
我们到目前为止
使用java Filter(参见下面的web.xml),我们可以根据端口号转发到每个servlet实现(通过添加额外的连接器来添加端口deploy/jbossweb.sar/server.xml).这适用于所有Web服务调用,但不适用于wsdl请求,例如http://localhost:8092/simulator/sim?wsdl8092是许多模拟器的所需版本(8091,8092,8093,8094).在该请求上,正确返回wsdl(每个模拟器实现略有不同),但URL soap:address标记始终使用端口8091.
注意:我们使用的是JBoss 5.0
web.xml的相关部分:
<filter>
<filter-name>SimFilter</filter-name>
<filter-class>com.example.filter.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SimFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud) 我在Netbeans 6.9.1上编写了一个java Web服务并部署在GlassFish 3.0.1上
我有一个像这样的"http:// localhost:8080/web2/service2Service?wsdl"的wsdl url.如何使用此URL从另一个Java应用程序访问此Web服务.
谢谢
使用Apache Axis2创建Web服务时应使用哪种方法(Contract-First/Code-First)?如果我选择契约优先方法,我应该使用哪个工具来创建wsdl?我正在使用WSO2平台.
如果这是微不足道的道歉.
我试图运行此代码 - http://oreilly.com/pub/h/974#code从Yahoo!获取URL 目录.
我无法获得谷歌API基本密钥,并在网上发现它不再需要了.
我也需要google.wsdl,并在Google的API常见问题解答(http://code.google.com/apis/soapsearch/api_faq.html#tech4)上找到它可以从http://api.google.com/上获取GoogleSearch.wsdl正在抛出404错误.
它也不是必需的吗?如果是,那么只需通过减少参数数量来改变方法调用就可以了吗?
有没有人对这个问题有任何想法?
当我运行命令时:
"C:\Program Files (x86)\Microsoft WSE\v3.0\Tools\WseWsdl3.exe" [WSDL location] /o:[file location] /l:cs /type:webClient
Run Code Online (Sandbox Code Playgroud)
其中[WSDL location]是本地计算机上Web服务的位置,[file location]是我的webService.asmx.cs文件位置的位置
我收到错误:
System.InvalidOperationException: Could not get the install directory for .NET F
ramework v2.0 SDK. Please install the .NET Framework v2.0 SDK.
at WseWsdl.WebServiceUtil.RunWsdl(String[] args)
Run Code Online (Sandbox Code Playgroud)
我谷歌这种错误,发现一个有用的链接WseWsdl3.exe在Windows 7 Ultimate 64位上生成错误由Robert Amiscaray 19.2009年11月11:31
我已经做了建议的更改,仍然得到相同的错误.
博客条目是正确的还是我需要做一些特殊的更改b/c我正在使用"Win 7 Pro Sp 1"?
我的理解是,MEX和WSDL是两种不同的发布元数据的方式.为了让客户选择他们喜欢的那个,我想同时启用它们.但我不完全确定如何.
我的webconfig只包含:
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
当浏览到它时显示默认页面,其中包含指向serviceblahblah?wsdl的链接,这表明我只发布了WSDL.
我的问题是,这是使用MEX,如果不是我怎样才能发布MEX,我应该发布两者吗?
我正在使用basichttpsbinding,如果这有任何区别.
每次我使用SOAPUI运行脚本时都会收到以下错误.它说连接被拒绝了.请帮忙.在我看来,有一些防火墙问题,但当我与我的网络人员谈话,但他们不认为这是防火墙.
java.lang.NullPointerException
at com.eviware.soapui.impl.rest.panels.request.views.html.HttpHtmlMessageExchangeResponseView.writeHttpBody(HttpHtmlMessageExchangeResponseView.java:211)
at com.eviware.soapui.impl.rest.panels.request.views.html.HttpHtmlMessageExchangeResponseView.setEditorContent(HttpHtmlMessageExchangeResponseView.java:190)
at com.eviware.soapui.impl.rest.panels.request.views.html.HttpHtmlMessageExchangeResponseView.buildContent(HttpHtmlMessageExchangeResponseView.java:106)
at com.eviware.soapui.impl.rest.panels.request.views.html.HttpHtmlMessageExchangeResponseView.getComponent(HttpHtmlMessageExchangeResponseView.java:66)
at com.eviware.soapui.support.editor.Editor.addEditorView(Editor.java:83)
at com.eviware.soapui.impl.support.components.ResponseMessageXmlEditor.<init>(ResponseMessageXmlEditor.java:49)
at com.eviware.soapui.impl.wsdl.support.MessageExchangeResponseMessageEditor.<init>(MessageExchangeResponseMessageEditor.java:33)
at com.eviware.soapui.impl.wsdl.support.MessageExchangeResponseMessageEditor.<init>(MessageExchangeResponseMessageEditor.java:28)
at com.eviware.soapui.impl.wsdl.teststeps.actions.ShowMessageExchangeAction.buildResponseTab(ShowMessageExchangeAction.java:192)
at com.eviware.soapui.impl.wsdl.teststeps.actions.ShowMessageExchangeAction.buildContent(ShowMessageExchangeAction.java:98)
at com.eviware.soapui.impl.wsdl.teststeps.actions.ShowMessageExchangeAction.buildFrame(ShowMessageExchangeAction.java:88)
at com.eviware.soapui.impl.wsdl.teststeps.actions.ShowMessageExchangeAction.actionPerformed(ShowMessageExchangeAction.java:76)
at com.eviware.soapui.support.action.swing.DefaultActionList.performDefaultAction(DefaultActionList.java:107)
at com.eviware.soapui.impl.wsdl.panels.testcase.JTestRunLog$LogListMouseListener.mouseClicked(JTestRunLog.java:228)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown …Run Code Online (Sandbox Code Playgroud) 我为SOAP Web服务创建了一个WSDL(Abstract).我必须在SOAP Request Reply中使用此WSDL.
但是在SOAPRequestReply的Service端口中,我必须指定一个具体的WSDL.因此,如果有任何方法可以创建具体的WSDL.
如果需要任何其他信息,请与我们联系.
我无法在JBoss 7.3.0中运行一些代码(请参阅下面的版本)来调用未在JBoss中运行的Web服务.我收到错误,如下所示.
我已经在各地寻找解决方案,所以任何操纵者都会非常感激.
我使用JBOSS_HOME\bin\wsconsume.bat工具生成了@WebServiceClient java类.我使用的技术是将URL和QName对象传递给@WebServiceClient类的构造函数.我可以看到代码能够从URL读取wsdl(使用http://地址),但正如您在下面的例外中所看到的,它无法看到这些方法.
我已经通过运行一个独立的Java应用程序来验证代码在JBoss之外工作,该应用程序执行相同的操作,它可以连接到webservice,调用方法并读取响应.
我注意到一些有趣的东西,如果我关闭了webservice,然后更改代码,从filesyetem(文件的URL:/而不是http://)本地存储的wsdl的副本中读取wsdl,那么相同的错误是生成,这对我来说似乎很奇怪,几乎就好像JBoss不允许传出连接到web服务.当webservice正在运行(并且代码被还原为使用http URL)时,看起来JBoss能够读取wsdl(日志记录显示已经从wsdl读取了Web方法)但是没有连接到webservice.
版本:
JBoss:EAP 6.2.0.GA(基于AS 7.3.0构建)Java:1.6.0_45
此处显示异常:
13:14:02,451 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) Creating Service {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}FR_MXWOWS from WSDL: file:/Dimensions/NIW_DEV/niw/ext/src/main/resources/wsdl/MockMaximoService.wsdl
13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}UpdateFR_MXWO.
13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}CreateFR_MXWO.
13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}DeleteFR_MXWO.
13:14:02,551 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}SyncFR_MXWO. …Run Code Online (Sandbox Code Playgroud)