本帖最后由 ahwwmb 于 2009-12-30 11:39:57 编辑

解决方案 »

  1.   

    参数不同呗,可以自己先用vs自动生成一个,然后修改.cs文件就OK了
      

  2.   

    有添加这个namespace + "." + classname类所在的程序集的引用吗?
      

  3.   

    Mark  这会儿比较忙了!
      

  4.   

    web reference problem?
    up
      

  5.   

    从上面看出动态Webservice调用主要使用动态编译以及C#的反射,如果发布的WebService不支持反射或者不是用C#发布,则C#的反射机制可能取不到类,从而报错;
      

  6.   

    其实代码没问题,是我没看好,之前拿到代码没看就试,所以没试出来,后来看了看代码才发现,“InvokeWebService”是个重载函数,如果webserver没有申明类名,就不传类名,代码就自动获取默认的类名,如果有申明类名,就必须要传,否则就找不到类,我就是这个原因导致出错的
      

  7.   

    其实代码没问题,是我没看好,之前拿到代码没看就试,所以没试出来,后来看了看代码才发现,“InvokeWebService”是个重载函数,如果webserver没有申明类名,就不传类名,代码就自动获取默认的类名,如果有申明类名,就必须要传,否则就找不到类,我就是这个原因导致出错的
      

  8.   

    当你打开webserver的时候,左上角蓝底的字就是类名,比如“http://www.webservicex.net/globalweather.asmx”这个webserver上显示的“GlobalWeather”就是类名
      

  9.   

    对方的webservice是JAVA写的,没有看到类名,只有页面报文
    如下:
     <?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions targetNamespace="http://sms.ccit.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://sms.ccit.com" xmlns:intf="http://sms.ccit.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <!-- WSDL created by Apache Axis version: 1.2.1
    Built on Aug 08, 2005 (11:49:10 PDT)
      --> 
    - <wsdl:types>
    - <schema targetNamespace="http://sms.ccit.com" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
    - <complexType name="ArrayOf_xsd_string">
    - <complexContent>
    - <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> 
      </restriction>
      </complexContent>
      </complexType>
    - <complexType name="ResponseInfo">
    - <sequence>
      <element name="p_IResult" type="xsd:int" /> 
      <element name="p_SMsg" nillable="true" type="xsd:string" /> 
      </sequence>
      </complexType>
      </schema>
      </wsdl:types>
      

  10.   

    怎么取java webservice的类名呀?
      

  11.   

    其实只要在vs里面导入web引用输入就可以看见类名。
    还有一种方法就是通过代码动态获得类名。