1

This is part of that question.

I want to integrate one system and the system strong required input/output params. The system works by wsdl. That's why I created a web-service on java :

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import java.util.Date;

@SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
public class WebServices {  

    @WebMethod
    public PerformTransactionResult Test2(){
        PerformTransactionResult performTransactionResult = new PerformTransactionResult();
        performTransactionResult.setErrorMsg("test");
        return performTransactionResult;
    }
}

my PerformTransactionResult class is:

import org.apache.cxf.aegis.type.java5.XmlType;    
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "PerformTransactionResult")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PerformTransactionResult")
public class PerformTransactionResult {    

    private String errorMsg;

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }  

}

System, which I'm integrating want to get response like that:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <uws:PerformTransactionResult xmlns:uws="http://uws.provider.com/">
            <errorMsg>Ok</errorMsg>     
        </uws:PerformTransactionResult>
    </s:Body>
</s:Envelope>

My web-service is getting response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <ns1:Test2Response xmlns:ns1="http://wservices.myhost.lan/">
            <return xmlns:ns2="http://wservices.myhost.lan/">
                <errorMsg>test</errorMsg>
            </return>
        </ns1:Test2Response>
    </soap:Body>
</soap:Envelope>

As you see, response should return PerformTransactionResult, not Test2Response. How to I implement that task ?

Community
  • 1
  • 1
Ulug'bek
  • 2,762
  • 6
  • 31
  • 59

0 Answers0