使用java websphere SOAP服务的C#客户端
我正在尝试使用.NET4.0中基于java的服务。(C#控制台/Windows服务)使用java websphere SOAP服务的C#客户端,c#,java,soap,websphere,C#,Java,Soap,Websphere,我正在尝试使用.NET4.0中基于java的服务。(C#控制台/Windows服务) 我已经使用VS的添加服务参考对话框添加了服务参考 该服务托管在WebSphere8上,WSDL定义是使用cxf生成的。 客户端应用程序正在Windows Server 2008 R2 SP1上运行。但我认为SP1之后不会应用任何windows更新 问题是,所有对服务方法的调用都会不时返回异常。错误如下: The content type text/xml;charset=UTF8 of the response
我已经使用VS的
添加服务参考
对话框添加了服务参考
该服务托管在WebSphere8上,WSDL定义是使用cxf生成的。客户端应用程序正在Windows Server 2008 R2 SP1上运行。但我认为SP1之后不会应用任何windows更新 问题是,所有对服务方法的调用都会不时返回异常。错误如下:
The content type text/xml;charset=UTF8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8).
If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.
The first 1024 bytes of the response were: '<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions name="MyServiceImplService" targetNamespace="http://impl.webService.myService.com/" xmlns:ns1="http://webService.myService.com/" xmlns:ns2="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://impl.webService.myService.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:import location="http://10.1.1.1/myService/webService/myService?wsdl=myService.wsdl" namespace="http://webService.myService.com/"></wsdl:import>
<wsdl:binding name="MyServiceImplServiceSoapBinding" type="ns1:myService">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap12:binding>
<wsdl:operation name="disableCard">
<soap12:operation soapAction="" style="documen'..
内容类型text/xml;响应消息的charset=UTF8与绑定的内容类型不匹配(application/soap+xml;charset=utf-8)。
如果使用自定义编码器,请确保正确实现IsContentTypeSupported方法。
响应的前1024个字节是:'
我想问一下关于使用另一个客户端进行测试的问题,所以您的soapUI测试确认了不是服务处于不良状态。你能在HTTP服务器日志或更低级别的网络监视器上看到请求是否到达服务器,以及它看起来是什么样子吗?@dbreaux我正在尝试这样做。仍然不可能。但是,似乎从端点地址中删除了?wsdl
,删除了重新启动系统的需要,重新启动客户端应用程序就足以让它再次工作。哦,是的?wsdl不应位于端点地址中。我没注意到。
<system.serviceModel>
<bindings>
<customBinding>
<binding name="MyServiceImplServiceSoapBinding">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://10.1.1.1/myService/webService/myService?wsdl"
binding="customBinding" bindingConfiguration="MyServiceImplServiceSoapBinding"
contract="MyServiceReference.myService" name="MyServiceImplPort" />
</client>
</system.serviceModel>