使用Spring消耗一个rpc风格的soap webservice

时间:2014-03-27 03:41:57

标签: java spring web-services soap spring-boot

我尝试使用Spring使用RPC样式的Soap WebService,我使用本指南http://spring.io/guides/gs/consuming-web-service/作为示例。我停留在“... WebServiceTemplate()。marshalSendAndReceive(request ...”,因为XJC任务不会生成resquest类,这是我试图实现的服务的wsdl:

        <wsdl:definitions name="AuthenticationService" targetNamespace="http://authservices.ws.gt.company.com/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://authservices.ws.gt.company.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
           <wsdl:types>
              <xs:schema targetNamespace="http://authservices.ws.gt.company.com/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                 <xs:complexType name="userInformationResponse">
                    <xs:sequence>
                       <xs:element minOccurs="0" name="alias" type="xs:string"/>
                       <xs:element minOccurs="0" name="bussinessPhone" type="xs:string"/>
                       <xs:element minOccurs="0" name="department" type="xs:string"/>
                       <xs:element minOccurs="0" name="email" type="xs:string"/>
                       <xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
                       <xs:element minOccurs="0" name="firt" type="xs:string"/>
                       <xs:element minOccurs="0" name="groups" type="tns:userInformationGroups"/>
                       <xs:element minOccurs="0" name="last" type="xs:string"/>
                       <xs:element minOccurs="0" name="mobilePhone" type="xs:string"/>
                       <xs:element minOccurs="0" name="title" type="xs:string"/>
                    </xs:sequence>
                 </xs:complexType>
                 <xs:complexType name="userInformationGroups">
                    <xs:sequence>
                       <xs:element maxOccurs="unbounded" minOccurs="0" name="group" nillable="true" type="xs:string"/>
                    </xs:sequence>
                 </xs:complexType>
              </xs:schema>
           </wsdl:types>
           <wsdl:message name="requestUserInfo">
              <wsdl:part name="ldapId" type="xsd:int"/>
              <wsdl:part name="user" type="xsd:string"/>
              <wsdl:part name="password" type="xsd:string"/>
           </wsdl:message>
           <wsdl:message name="requestUserInfoResponse">
              <wsdl:part name="userInfo" type="tns:userInformationResponse"/>
           </wsdl:message>
           <wsdl:portType name="AuthService">
              <wsdl:operation name="requestUserInfo">
                 <wsdl:input message="tns:requestUserInfo" name="requestUserInfo"/>
                 <wsdl:output message="tns:requestUserInfoResponse" name="requestUserInfoResponse"/>
              </wsdl:operation>
           </wsdl:portType>
           <wsdl:binding name="AuthenticationServiceSoapBinding" type="tns:AuthService">
              <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="requestUserInfo">
                 <soap:operation soapAction="" style="rpc"/>
                 <wsdl:input name="requestUserInfo">
                    <soap:body namespace="http://authservices.ws.gt.company.com/" use="literal"/>
                 </wsdl:input>
                 <wsdl:output name="requestUserInfoResponse">
                    <soap:body namespace="http://authservices.ws.gt.company.com/" use="literal"/>
                 </wsdl:output>
              </wsdl:operation>
           </wsdl:binding>
           <wsdl:service name="AuthenticationService">
              <wsdl:port binding="tns:AuthenticationServiceSoapBinding" name="AuthServicePort">
                 <soap:address location="http://HOST/authservices/AuthService"/>
              </wsdl:port>
           </wsdl:service>
        </wsdl:definitions>

0 个答案:

没有答案