.net 调用一个java的webservice 
.net 这边不做任何封装 。引用webservice 
ReimburService.importClaimInfoInput Interface = new FlowWindowsServices.ReimburService.importClaimInfoInput();
Interface.source_code =Convert.ToInt32(rowMain["来源ID"].ToString());直接调用里面的类。调用服务,发出数据时ReimburService.CostManagementSrvImplService ReportService = new FlowWindowsServices.ReimburService.CostManagementSrvImplService();
ReportService.RequestEncoding = System.Text.Encoding.UTF8;
ReimburService.importClaimInfoOutput outList = ReportService.importClaimInfo(Interface);报异常为下:System.Web.Services.Protocols.SoapHeaderException: Error reading XMLStreamReader.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at FlowWindowsServices.ReimburService.CostManagementSrvImplService.importClaimInfo(importClaimInfoInput importInput) in D:\work\ProjectWork\FlowWindowsServices\Web References\ReimburService\Reference.cs:line 61
   at FlowWindowsServices.Service.ExpenseAccountService.InterfaceTransfers(ObjService inParam_, ObjService outParam_) in d:\work\projectwork\flowwindowsservices\service\expenseaccountservice.cs:line 153
   at FlowWindowsServices.Service.ExpenseAccountService.invokeInstanceMethod(ObjService inParam_, ObjService outParam_) in d:\work\projectwork\flowwindowsservices\service\expenseaccountservice.cs:line 49
不知道 什么原因了。因为我们什么都没做。
点开网址看他们的webservice 生成的xml 也很奇怪- <wsdl:binding name="CostManagementSrvImplServiceSoapBinding" type="ns1:ICostManagementSrv">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <wsdl:operation name="queryClaimInfo">
  <soap:operation soapAction="" style="document" /> 
- <wsdl:input name="queryClaimInfo">
  <soap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output name="queryClaimInfoResponse">
  <soap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
- <wsdl:operation name="importClaimInfo">
  <soap:operation soapAction="" style="document" /> 
- <wsdl:input name="importClaimInfo">
  <soap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output name="importClaimInfoResponse">
  <soap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="CostManagementSrvImplService">
- <wsdl:port binding="tns:CostManagementSrvImplServiceSoapBinding" name="CostManagementSrvImplPort">
  <soap:address location="http://10.0.198.248:8088/cusfs03/services/costManagementService" /> 
  </wsdl:port>
  </wsdl:service>类里面的字段都看不到,请高手指点,是哪边的问题。

解决方案 »

  1.   

    网址可以打开。就是显示的 如我上面说的xml节
      

  2.   

    是不是返回了,.NET不支持的类型
      

  3.   

    java中是否可以调用,可能返回数据不正确
      

  4.   

    说是用java 可以调用。他们抓包回来说,我们送过去的xml
    Headers: {SOAPAction=[""], User-Agent=[Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2443)], Host=[10.0.198.248:8088], Expect=[100-continue], Content-Length=[1272], Content-Type=[text/xml; charset=utf-8], connection=[Keep-Alive], content-type=[text/xml; charset=utf-8]}
    Payload: ?<?xml version="1.0" encoding="utf-8"?>Payload: 后面有个? 。对方比较牛。不怎么给调
      

  5.   

    找到问题了。
    他们给了一个其他的webservice 就是可以通信的。给我们接口的webservice 有问题。开始他们说。他们是全国项目,不会因为我们去变动。
    我都气死了。先在好了。发现他这个接口不通了。呵呵,窃喜一下。
      

  6.   

    to 11楼的兄弟:
    我想问一下,一个全国项目中的webservice,可能会因为一个省的客户端调不通就修改吗?在下一点也不牛,但是在下胆小,领导说不能动的东西在下不敢随便动……
    而且我已经帮LZ找了一下午原因了,请您在下结论之前稍微了解一下真相行不?说个大家耳熟能详的故事吧:
    有一次苏东坡问佛印:你看我像什么?佛印答:像佛。佛印反问:你看我像什么?东坡大笑说:像粪。佛印笑而不语。回家后东坡对苏小妹说:我今天斗嘴赢了。小妹说:兄长你输了啊,佛印心中有佛自然看你如佛,你心中只有粪,所以看别人像粪啊。呃,话说,11楼的兄弟看我不如狗屁吗?