沙
沙隆巴斯的主人
Unregistered / Unconfirmed
GUEST, unregistred user!
WEB SERVICE服务器由JAVA实现(TOMCAT+AXIS)
在一个JWS中有两个方法:getName与getPhoneBook
整个文件如下所示
public class HelloClient
{
public String getName(String name)
{
return "hello "+name;
}
public PhoneBook getPhoneBook(){
PhoneBook result = new PhoneBook();
result.name = "0";
result.number = 0;
return result;
}
}
其中PhoneBook 的定义如下:
public class PhoneBook{
public String name;
public int number;
};
以上文件部署后通过浏览器可以访问到
-
<wsdl:definitions targetNamespace="http://xbw1:1977/axis/HelloClient.jws">
-
<!--
WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)
-->
-
<wsdl:types>
-
<schema targetNamespace="http://DefaultNamespace">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
-
<complexType name="PhoneBook">
-
<sequence>
<element name="name"
nillable="true"
type="xsd:string"/>
<element name="number"
type="xsd:int"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
-
<wsdl:message name="getNameRequest">
<wsdlart name="name"
type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getPhoneBookRequest">
</wsdl:message>
-
<wsdl:message name="getPhoneBookResponse">
<wsdlart name="getPhoneBookReturn"
type="tns1honeBook"/>
</wsdl:message>
-
<wsdl:message name="getNameResponse">
<wsdlart name="getNameReturn"
type="xsd:string"/>
</wsdl:message>
-
<wsdlortType name="HelloClient">
-
<wsdlperation name="getPhoneBook">
<wsdl:input message="impl:getPhoneBookRequest"
name="getPhoneBookRequest"/>
<wsdlutput message="impl:getPhoneBookResponse"
name="getPhoneBookResponse"/>
</wsdlperation>
-
<wsdlperation name="getName"
parameterOrder="name">
<wsdl:input message="impl:getNameRequest"
name="getNameRequest"/>
<wsdlutput message="impl:getNameResponse"
name="getNameResponse"/>
</wsdlperation>
</wsdlortType>
-
<wsdl:binding name="HelloClientSoapBinding"
type="impl:HelloClient">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
-
<wsdlperation name="getPhoneBook">
<wsdlsoapperation soapAction=""/>
-
<wsdl:input name="getPhoneBookRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://DefaultNamespace"
use="encoded"/>
</wsdl:input>
-
<wsdlutput name="getPhoneBookResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xbw1:1977/axis/HelloClient.jws"
use="encoded"/>
</wsdlutput>
</wsdlperation>
-
<wsdlperation name="getName">
<wsdlsoapperation soapAction=""/>
-
<wsdl:input name="getNameRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://DefaultNamespace"
use="encoded"/>
</wsdl:input>
-
<wsdlutput name="getNameResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xbw1:1977/axis/HelloClient.jws"
use="encoded"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
-
<wsdl:service name="HelloClientService">
-
<wsdlort binding="impl:HelloClientSoapBinding"
name="HelloClient">
<wsdlsoap:address location="http://xbw1:1977/axis/HelloClient.jws"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>
在一个JWS中有两个方法:getName与getPhoneBook
整个文件如下所示
public class HelloClient
{
public String getName(String name)
{
return "hello "+name;
}
public PhoneBook getPhoneBook(){
PhoneBook result = new PhoneBook();
result.name = "0";
result.number = 0;
return result;
}
}
其中PhoneBook 的定义如下:
public class PhoneBook{
public String name;
public int number;
};
以上文件部署后通过浏览器可以访问到
-
<wsdl:definitions targetNamespace="http://xbw1:1977/axis/HelloClient.jws">
-
<!--
WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)
-->
-
<wsdl:types>
-
<schema targetNamespace="http://DefaultNamespace">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
-
<complexType name="PhoneBook">
-
<sequence>
<element name="name"
nillable="true"
type="xsd:string"/>
<element name="number"
type="xsd:int"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
-
<wsdl:message name="getNameRequest">
<wsdlart name="name"
type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getPhoneBookRequest">
</wsdl:message>
-
<wsdl:message name="getPhoneBookResponse">
<wsdlart name="getPhoneBookReturn"
type="tns1honeBook"/>
</wsdl:message>
-
<wsdl:message name="getNameResponse">
<wsdlart name="getNameReturn"
type="xsd:string"/>
</wsdl:message>
-
<wsdlortType name="HelloClient">
-
<wsdlperation name="getPhoneBook">
<wsdl:input message="impl:getPhoneBookRequest"
name="getPhoneBookRequest"/>
<wsdlutput message="impl:getPhoneBookResponse"
name="getPhoneBookResponse"/>
</wsdlperation>
-
<wsdlperation name="getName"
parameterOrder="name">
<wsdl:input message="impl:getNameRequest"
name="getNameRequest"/>
<wsdlutput message="impl:getNameResponse"
name="getNameResponse"/>
</wsdlperation>
</wsdlortType>
-
<wsdl:binding name="HelloClientSoapBinding"
type="impl:HelloClient">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
-
<wsdlperation name="getPhoneBook">
<wsdlsoapperation soapAction=""/>
-
<wsdl:input name="getPhoneBookRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://DefaultNamespace"
use="encoded"/>
</wsdl:input>
-
<wsdlutput name="getPhoneBookResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xbw1:1977/axis/HelloClient.jws"
use="encoded"/>
</wsdlutput>
</wsdlperation>
-
<wsdlperation name="getName">
<wsdlsoapperation soapAction=""/>
-
<wsdl:input name="getNameRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://DefaultNamespace"
use="encoded"/>
</wsdl:input>
-
<wsdlutput name="getNameResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xbw1:1977/axis/HelloClient.jws"
use="encoded"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
-
<wsdl:service name="HelloClientService">
-
<wsdlort binding="impl:HelloClientSoapBinding"
name="HelloClient">
<wsdlsoap:address location="http://xbw1:1977/axis/HelloClient.jws"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>