2016-07-11 9 views
0

implementiert wird. Ich versuche, einen einfachen Webservice zu implementieren und ihn für WebSphere Liberty bereitzustellen. Ich habe ein Problem, aber die WSDL kann extern aufgerufen werden, aber wenn ich den Service in SoapUI laden und eine Anfrage machen, wird der Service nicht einmal aufgerufen und die Antwort ist leer. Ich bekomme xml zurück, aber die Antwort ist leer xml Objekte.Der JAX-WS-Webdienst wird nicht aufgerufen, wenn er auf dem IBM WebSphere Liberty-Profil

Dies ist die SEI:

package cn.ord.services; 

import javax.jws.WebMethod; 
import javax.jws.WebParam; 
import javax.jws.WebResult; 
import javax.jws.WebService; 
import javax.xml.bind.annotation.XmlSeeAlso; 
import javax.xml.ws.RequestWrapper; 
import javax.xml.ws.ResponseWrapper; 

@WebService(name = "DORPaymentServicesDelegate", targetNamespace = "http://services.ord.cn/") 
@XmlSeeAlso({ 
    ObjectFactory.class 
}) 
public interface DORPaymentServicesDelegate { 


    /** 
    * 
    * @param paymentInfo 
    * @param formType 
    * @param form 
    * @return 
    *  returns cn.ord.services.ReturnStatus 
    */ 
    @WebMethod 
    @WebResult(targetNamespace = "http://services.ord.cn/") 
    @RequestWrapper(localName = "submitTransaction", targetNamespace = "http://services.ord.cn/", className = "cn.ord.services.SubmitTransaction") 
    @ResponseWrapper(localName = "submitTransactionResponse", targetNamespace = "http://services.ord.cn/", className = "cn.ord.services.SubmitTransactionResponse") 
    public ReturnStatus submitTransaction(
     @WebParam(name = "form", targetNamespace = "") 
     SerializedForm form, 
     @WebParam(name = "paymentInfo", targetNamespace = "") 
     PaymentInfo paymentInfo, 
     @WebParam(name = "formType", targetNamespace = "") 
     String formType); 

    /** 
    * 
    * @param amount 
    * @return 
    *  returns java.lang.String 
    */ 
    @WebMethod 
    @WebResult(targetNamespace = "http://services.ord.cn/") 
    @RequestWrapper(localName = "calculateCCFee", targetNamespace = "http://services.ord.cn/", className = "cn.ord.services.CalculateCCFee") 
    @ResponseWrapper(localName = "calculateCCFeeResponse", targetNamespace = "http://services.ord.cn/", className = "cn.ord.services.CalculateCCFeeResponse") 
    public String calculateCCFee(
     @WebParam(name = "amount", targetNamespace = "") 
     String amount); 

} 

Und das ist die Umsetzung Klasse:

package cn.ord.services; 

@javax.jws.WebService(endpointInterface = "cn.ord.services.DORPaymentServicesDelegate", targetNamespace = "http://services.ord.cn/", serviceName = "DORPaymentServicesService", portName = "DORPaymentServicesPort") 
public class DORPaymentServicesPortBindingImpl implements DORPaymentServicesDelegate 
{ 

    public ReturnStatus submitTransaction(SerializedForm form, PaymentInfo paymentInfo, 
      String formType) 
    { 

     System.out.println("service hit"); 

     ReturnStatus rs = new ReturnStatus(); 

     rs.setDORConfirmationNUmber("1234567"); 
     rs.setResultMessage("Hello newton, I am your father"); 
     rs.setReturnCode("Code Red"); 
     rs.setStatus("SUCCESS"); 

     return rs; 
    } 

    public String calculateCCFee(String amount) 
    { 

     return new String("calculate fee response newton"); 
    } 

} 

Und das ist mein webservices.xml Einsatz descriptior:

<?xml version="1.0" encoding="UTF-8"?> 
<webservices xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_1_4.xsd" version="1.4"> 
    <webservice-description> 
     <webservice-description-name>DORPaymentServicesService</webservice-description-name> 
     <port-component> 
      <port-component-name>DORPaymentServicesDelegate</port-component-name> 
      <wsdl-service xmlns:pfx="http://services.ord.cn/"> 
      pfx:DORPaymentServicesService</wsdl-service> 
      <wsdl-port xmlns:pfx="http://services.ord.cn/"> 
      pfx:DORPaymentServicesPort</wsdl-port> 
      <enable-mtom>false</enable-mtom> 
      <service-endpoint-interface>cn.ord.services.DORPaymentServicesDelegate</service-endpoint-interface> 
      <service-impl-bean> 
       <servlet-link> 
       cn.ord.services.DORPaymentServicesPortBindingImpl</servlet-link> 
      </service-impl-bean> 
     </port-component> 
    </webservice-description> 
</webservices> 

Also ich bin in der Lage, den Dienst anzurufen und die WSDL durch den Aufruf "https://mi-desktop.rsi:9443/NCDORServices/DORPaymentServicesService?wsdl" zu generieren, aber wenn ich th at in soap ui und rufen Sie eine der Methoden ich bekomme eine XML-Antwort mit leeren Tags und die Debugging-Anweisung in der Implementierungsklasse wird überhaupt nicht gesehen.

Ich hatte dies funktioniert einmal und ich aktualisierte die WSDL. Also habe ich die Klassen und den Blamo neu erstellt - es hat plötzlich aufgehört zu arbeiten. Es wurde nichts über die Bereitstellung geändert.

Was mache ich falsch?

Antwort

0

Ich bin ein Idiot, anscheinend Finsternis hat das Quellprojekt nicht wirklich neu aufgebaut. Ich musste meinen Arbeitsplatz säubern und neu aufbauen und es funktioniert jetzt gut.

Es sollte angemerkt werden, dass Liberty diesen Dienst ohne den Deployment-Deskriptor nicht ordnungsgemäß bereitstellen wird, selbst wenn die Annotationen richtig angegeben sind.

Verwandte Themen