I tried what happens if i use a wsdl. First without out wsdl:
The Service:
@WebService(
name="IVRService", serviceName = "IVRService",
targetNamespace="http://www.akademi-consulting.com.tr/services")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
use=SOAPBinding.Use.LITERAL,
parameterStyle=ParameterStyle.WRAPPED)
public class IVRCallServiceImpl{
@WebMethod(operationName="checkCompanyByPhoneNumber")
public CompanyCheckResult checkCompanyByPhoneNumber(String phone){
try{
//CompanyCheckResult result =
dao.checkCompanyByPhoneNumber(phone);
CompanyCheckResult result = new CompanyCheckResult();
result.setStatusCode(0);
result.setCompanyCode("sdfsdfewer");
return result;
}catch(Exception ex){
}
return null;
}
}
and the response for method call:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:checkCompanyByPhoneNumberResponse
xmlns:ns="http://www.akademi-consulting.com.tr/services">
<ns:return xmlns:ax21="http://model.ivr.akademi.com/xsd"
type="com.akademi.ivr.model.CompanyCheckResult">
<ax21:companyCode>sdfsdfewer</ax21:companyCode>
<ax21:statusCode>0</ax21:statusCode>
</ns:return>
</ns:checkCompanyByPhoneNumberResponse>
</soapenv:Body>
</soapenv:Envelope>
now i got the auto-generated wsdl, changed namespaces to what i wanted, put
the wsdl into META-INF folder of .aar archive and told axis to use my wsdl.
The service: same only wsdlLocation="META-INF/IVRService.wsdl" attribute is
added to annotation
the response:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:checkCompanyByPhoneNumberResponse
xmlns:ns="http://www.akademi-consulting.com.tr/types/ivr">
<ns:return type="com.akademi.ivr.model.CompanyCheckResult">
<ns:companyCode>sdfsdfewer</ns:companyCode>
<ns:statusCode>0</ns:statusCode>
</ns:return>
</ns:checkCompanyByPhoneNumberResponse>
</soapenv:Body>
</soapenv:Envelope>
everything is ok, but namespace of the ns:return element which is different
from parent is missing. there is nothing i did here. my wsdl has only the
namespaces changed, not the structure but the response is missing it. so
client ( generated by axis2 itself again) fails because response does not
comply with my wsdl. i've tried different combinations of annotations
(@WebResult, @ResponseWrapper etc) but i can't make this work.
original wsdl is this:
http://www.nabble.com/file/p21682850/IVRService-orig.wsdl
IVRService-orig.wsdl
and my wsdl : http://www.nabble.com/file/p21682850/IVRService.wsdl
IVRService.wsdl
--
View this message in context:
http://www.nabble.com/Axis2-1.4-JAX-WS-annotated-service-namespace-problem-tp21681159p21682850.html
Sent from the Axis - User mailing list archive at Nabble.com.