请问XXXXXstub怎么使用?
1, 先生成java代码:
wsdl2java -d xmlbeans -uri C:\work\Helloworld.wsdl
有一个 HelloWorldServiceStub ,
方法
public helloworld.GetGreetingsResponseDocument getGreetings(
helloworld.GetGreetingsDocument getGreetings0)
throws java.rmi.RemoteException
{
....
....
}
2 我看了一下参数和返回值helloworld.GetGreetingsResponseDocument ,helloworld.GetGreetingsDocument都是interface
3我想做一个HelloClient调用stub的 getGreetings ,怎么做?
附上wsdl:
<wsdl:definitions targetNamespace="http://helloworld"
xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="helloworld">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://helloworld"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getGreetings">
<complexType>
<sequence>
<element name="name" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getGreetingsResponse">
<complexType>
<sequence>
<element name="getGreetingsReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getGreetingsRequest">
<wsdl:part element="tns:getGreetings" name="parameters"/>
</wsdl:message>
<wsdl:message name="getGreetingsResponse">
<wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="HelloWorld">
<wsdl:operation name="getGreetings">
<wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
<wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getGreetings">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getGreetingsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getGreetingsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldService">
<wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
<wsdlsoap:address location="http://localhost:8085/HelloWorldService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>