| 发表于:2008-01-13 06:36:49 楼主 |
我用java cxf 写的web service,已经用java客户调试通过了.但是.net客户还不行.我对.net一点也不懂. 弄了2天了,还是不知道为何不行. 以下是我的步骤: 1)creat a web site; 2)添加web引用, 在url 中输入 问题开始出现了,我java定义的 web service 接受2个参数,并声明抛出一个异常. string sayhi(string text, profile info) throws businesslogicexception; 现在它不能够正确找到方法.它找到的方法: sayhi(textas string) as string 但是丢了一个profile info 参数和异常! 3)如果我在 .cs 文件调用就出错,因为根本没法编译 localhost.helloworldimpservice 另外,如果我添加 service 引用,servicereference 可以找到profile, businesslogicexception. 以下是我的wsdl文件.哪位大虾指点一下啊. <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://spring.demo/" xmlns:xsd="http://www.w3.org/2001/xmlschema" name="helloworldservice" targetnamespace="http://spring.demo/"> <wsdl:types> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" attributeformdefault="unqualified" elementformdefault="unqualified" targetnamespace="http://spring.demo/" xmlns:tns="http://spring.demo/"> <xs:element name="businesslogicfaultdetail" nillable="true" type="tns:businesslogicfaultdetail"/> <xs:element name="sayhi" nillable="true" type="tns:sayhi"/> <xs:element name="sayhiresponse" nillable="true" type="tns:sayhiresponse"/> <xs:complextype name="sayhi"> <xs:sequence> <xs:element minoccurs="0" name="text" type="xs:string"/> <xs:element minoccurs="0" name="info" type="tns:profileinfo"/> </xs:sequence> </xs:complextype> <xs:complextype name="profileinfo"> <xs:sequence> <xs:element minoccurs="0" name="addressline1" type="xs:string"/> <xs:element minoccurs="0" name="addressline2" type="xs:string"/> <xs:element minoccurs="0" name="city" type="xs:string"/> <xs:element minoccurs="0" name="companyname" type="xs:string"/> <xs:element minoccurs="0" name="email" type="xs:string"/> <xs:element minoccurs="0" name="fax" type="xs:string"/> <xs:element minoccurs="0" name="firstname" type="xs:string"/> <xs:element minoccurs="0" name="lastname" type="xs:string"/> <xs:element minoccurs="0" name="middlename" type="xs:string"/> <xs:element minoccurs="0" name="mobile" type="xs:string"/> <xs:element minoccurs="0" name="phone" type="xs:string"/> <xs:element minoccurs="0" name="state" type="xs:string"/> <xs:element minoccurs="0" name="status" type="xs:string"/> <xs:element minoccurs="0" name="zip" type="xs:string"/> </xs:sequence> </xs:complextype> <xs:complextype name="sayhiresponse"> <xs:sequence> <xs:element minoccurs="0" name="return" type="xs:string"/> </xs:sequence> </xs:complextype> <xs:complextype name="businesslogicfaultdetail"/> </xs:schema> </wsdl:types> <wsdl:message name="businesslogicexception"> <wsdl:part element="tns:businesslogicfaultdetail" name="businesslogicexception"> </wsdl:part> </wsdl:message> <wsdl:message name="sayhiresponse"> <wsdl:part element="tns:sayhiresponse" name="parameters"> </wsdl:part> </wsdl:message> <wsdl:message name="sayhi"> <wsdl:part element="tns:sayhi" name="parameters"> </wsdl:part> </wsdl:message> <wsdl:porttype name="helloworld"> <wsdl:operation name="sayhi"> <wsdl:input message="tns:sayhi" name="sayhi"> </wsdl:input> <wsdl:output message="tns:sayhiresponse" name="sayhiresponse"> </wsdl:output> <wsdl:fault message="tns:businesslogicexception" name="businesslogicexception"> </wsdl:fault> </wsdl:operation> </wsdl:porttype> <wsdl:binding name="helloworldservicesoapbinding" type="tns:helloworld"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="sayhi"> <soap:operation soapaction="" style="document"/> <wsdl:input name="sayhi"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="sayhiresponse"> <soap:body use="literal"/> </wsdl:output> <wsdl:fault name="businesslogicexception"> <soap:fault name="businesslogicexception" use="literal"/> </wsdl:fault> </wsdl:operation> </wsdl:binding> <wsdl:service name="helloworldservice"> <wsdl:port binding="tns:helloworldservicesoapbinding" name="helloworldport"> <soap:address location="http://localhost:9090/spring_http/ws/serverendpoint"/> </wsdl:port> </wsdl:service> </wsdl:definitions> |
|
|
|
|