Hello i've created an annotated service like below (it is in an .aar archive
uploaded to axis, not a single pojo file):
@WebService(name="IVRService", serviceName = "IVRService",
endpointInterface="com.akademi.ivr.service.IVRCallService",
targetNamespace="http://www.akademi-consulting.com.tr/services")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL)
public class IVRCallServiceImpl implements IVRCallService {
public CompanyCheckResult checkCompanyByPhoneNumber(String phone)
throws IVRServiceException {
try{
CompanyCheckResult result = new CompanyCheckResult();
result.setStatusCode(0);
result.setCompanyCode("sdfsdfewer");
return result;
}catch(Exception ex){
}
return null;
}
}
when you call this checkCompanyByPhoneNumber method response SOAP is like
this:
<?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:ax24="http://model.ivr.akademi.com/xsd"
xmlns:ax21="http://exception.ivr.akademi.com/xsd"
type="com.akademi.ivr.model.CompanyCheckResult">
<ax24:companyCode>sdfsdfewer</ax24:companyCode>
<ax24:statusCode>0</ax24:statusCode>
</ns:return>
</ns:checkCompanyByPhoneNumberResponse>
</soapenv:Body>
</soapenv:Envelope>
there is no real problem here but i want the namespaces of elements to be
different than axis2 uses
so i add a few more annotations to class:
@WebService(name="IVRService", serviceName = "IVRService",
endpointInterface="com.akademi.ivr.service.IVRCallService",
targetNamespace="http://www.akademi-consulting.com.tr/services")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL)
public class IVRCallServiceImpl implements IVRCallService {
@WebMethod(operationName="checkCompanyByPhoneNumber",
action="http://www.akademi-consulting.com.tr/services/ivr/checkCompanyByPhone")
@RequestWrapper(localName="checkCompanyByPhoneNumber",
targetNamespace="http://www.akademi-consulting.com.tr/types/ivr")
@WebResult(name="CompanyCheckResult",
targetNamespace="http://www.akademi-consulting.com.tr/model/ivr")
@ResponseWrapper(localName="checkCompanyByPhoneNumberResponse",
targetNamespace="http://www.akademi-consulting.com.tr/types/ivr")
public CompanyCheckResult checkCompanyByPhoneNumber(String phone)
throws IVRServiceException {
try{
CompanyCheckResult result = new CompanyCheckResult();
result.setStatusCode(0);
result.setCompanyCode("sdfsdfewer");
return result;
}catch(Exception ex){
}
return null;
}
}
now i expected the response look like this; ns and ax24 prefixes point to
new namespaces:
<?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/types/ivr">
<ns:return xmlns:ax24="http://www.akademi-consulting.com.tr/model/ivr"
xmlns:ax21="http://exception.ivr.akademi.com/xsd"
type="com.akademi.ivr.model.CompanyCheckResult">
<ax24:companyCode>sdfsdfewer</ax24:companyCode>
<ax24:statusCode>0</ax24:statusCode>
</ns:return>
</ns:checkCompanyByPhoneNumberResponse>
</soapenv:Body>
</soapenv:Envelope>
but response is still like the first one.
What is the problem here ? I know annotations are processed because when i
view auto-generated wsdl, i see service namespace and action attributes are
correct. But, i can't make the namespaces as i wanted.
--
View this message in context:
http://www.nabble.com/Axis2-1.4-JAX-WS-annotated-service-namespace-problem-tp21681159p21681159.html
Sent from the Axis - User mailing list archive at Nabble.com.