<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="TestImplService" targetNamespace="http://service.mx.com/" xmlns:ns1="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.mx.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
  <wsdl:types> 
<xs:schema elementFormDefault="unqualified" targetNamespace="http://service.mx.com/" version="1.0" xmlns:tns="http://service.mx.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
<xs:element name="example" type="tns:example" /> 
<xs:element name="exampleResponse" type="tns:exampleResponse" /> 
<xs:complexType name="example"> 
<xs:sequence> 
<xs:element minOccurs="0" name="arg0" type="xs:string" /> 
</xs:sequence> 
</xs:complexType> 
<xs:complexType name="exampleResponse"> 
<xs:sequence> 
<xs:element minOccurs="0" name="return" type="xs:string" /> 
</xs:sequence> 
</xs:complexType> 
</xs:schema> 
  </wsdl:types> 
  <wsdl:message name="exampleResponse"> 
    <wsdl:part element="tns:exampleResponse" name="parameters"> 
    </wsdl:part> 
  </wsdl:message> 
  <wsdl:message name="example"> 
    <wsdl:part element="tns:example" name="parameters"> 
    </wsdl:part> 
  </wsdl:message> 
  <wsdl:portType name="ITest"> 
    <wsdl:operation name="example"> 
      <wsdl:input message="tns:example" name="example"> 
    </wsdl:input> 
      <wsdl:output message="tns:exampleResponse" name="exampleResponse"> 
    </wsdl:output> 
    </wsdl:operation> 
  </wsdl:portType> 
  <wsdl:binding name="TestImplServiceSoapBinding" type="tns:ITest"> 
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
    <wsdl:operation name="example"> 
      <soap:operation soapAction="" style="document" /> 
      <wsdl:input name="example"> 
        <soap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output name="exampleResponse"> 
        <soap:body use="literal" /> 
      </wsdl:output> 
    </wsdl:operation> 
  </wsdl:binding> 
  <wsdl:service name="TestImplService"> 
    <wsdl:port binding="tns:TestImplServiceSoapBinding" name="TestImplPort"> 
      <soap:address location="http://localhost:8080/mx2011/example" /> 
    </wsdl:port> 
  </wsdl:service> 
</wsdl:definitions>
这个是执行了wsdl后xml文件,我现在在php中调用使用一下的方法header("content-type:text ml;charset=utf-8");
    try {
        $client = new SoapClient(" http://********/mx2011/example?wsdl",array('encoding'=>'UTF-8'));
     
     $parm1 = "***";
     $param = array('message' => $parm1);
     $arr = $client->example($param);
     print_r($arr); 
    } catch (SOAPFault $e) {
        print $e;
    }传给java的值总是显示null,但是能回调数据。
大家帮我看看

解决方案 »

  1.   

    我现在也在搞这个问题,原因大概知道了,
    <xs:complexType name="exampleResponse">  
    <xs:sequence>  
    在这里,你把方法发布成了复杂类型
      <wsdl:message name="exampleResponse">  
      <wsdl:part element="tns:exampleResponse" name="parameters">  
      </wsdl:part>  
      </wsdl:message>  
    方法应该只在message中存在。
    你用JDK6 自带的wsinport命令生成以下Client就会发现,你的每个方法都生成了一个文件,而不是生成一个借口和实现类。
    我只做到这步了
    如果你找到方法请公布出来,给大家分享一下
      

  2.   

    搞了半天搞出来了。
    在要发布的借口类上边使用CXF批注声明发布的文件类型,如下
    @WebService
    @SOAPBinding(style = SOAPBinding.Style.RPC)
    public interface Service {
         。。
    }