0
전에 JAX-WS에서 게시 한 웹 서비스를 사용하려고합니다. 로컬 환경에서 nusoap 호출을 수행 할 때 요청 된 모든 데이터가 제공됩니다. 그러나 일단 내 Dev 환경에 Java 응용 프로그램을 배포하면 서버 측에서 널 포인터 예외를 리턴합니다.간단한 nusoap 요청은 java.lang.nullPointerException을 반환합니다.
아래 코드는 제발 JAX WS를 사용 해본 적이 없기 때문에 필요한 추가 정보를 제공하게되어 기쁩니다. 미리 감사드립니다 !!! (관련 부분) 아래의 예를 URL에 게시
XML 파일,
http://services.myapp.dev.com:8080/myapp-1.0-SNAPSHOT/MyService?wsdl
/* 내용 */
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!--
Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#${svn.Last.Changed.Rev}.
-->
<!--
Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#${svn.Last.Changed.Rev}.
-->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.myapp.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://service.myapp.com/" name="MyServiceService">
<types>
<xsd:schema>
<xsd:import namespace="http://service.myapp.com/" schemaLocation="http://services.myapp.com:8080/myapp-1.0-SNAPSHOT/MyService?xsd=1"/>
</xsd:schema>
</types>
<message name="SearchDailyRecords">
<part name="parameters" element="tns:SearchDailyRecords"/>
</message>
<message name="SearchDailyRecordsResponse">
<part name="parameters" element="tns:SearchDailyRecordsResponse"/>
</message>
<portType name="MyService">
<operation name="SearchDailyRecords">
<input wsam:Action="http://services.myapp.com:8080/myapp-1.0-SNAPSHOT/MyService/SearchDailyRecordsRequest" message="tns:SearchDailyRecords"/>
<output wsam:Action="http://services.myapp.com:8080/myapp-1.0-SNAPSHOT/MyService/SearchDailyRecordsResponse" message="tns:SearchDailyRecordsResponse"/>
<fault message="tns:Exception" name="Exception" wsam:Action="http://services.myapp.com:8080/myapp-1.0-SNAPSHOT/MyService/SearchDailyRecords/Fault/Exception"/>
</operation>
</portType>
<binding name="MyServicePortBinding" type="tns:MyService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="SearchDailyRecords">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
</binding>
<service name="MyServiceService">
<port name="MyServicePort" binding="tns:MyServicePortBinding">
<soap:address location="http://services.myapp.com:8080/myapp-1.0-SNAPSHOT/MyService"/>
</port>
</service>
</definitions>
자바 백엔드 서비스 :
@Override
public @WebResult(name = "response")
List<SearchDailyRecordsResponse> SearchDailyRecords(@WebParam(name = "employeeId") @XmlElement(required = true) String employeeId, @WebParam(name = "date") @XmlElement(required = true) String date) throws Exception {
SearchDailyRecordsRequest request = new SearchDailyRecordsRequest();
request.employeeId = employeeId;
request.date = date;
try {
IDailyRecordDAO dailyRecordDAO = (IDailyRecordDAO) DAOFactory.getInstance().getDAO("DailyRecord");
List<DailyRecord> dailyRecords = registroGenericoDAO.get(request.employeeId, request.date);
List<SearchDailyRecordsResponse> response = new ArrayList<SearchDailyRecordsResponse>();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
for (DailyRecord dailyRecord : dailyRecords) {
SearchDailyRecordsResponse searchDailyRecords = new SearchDailyRecordsResponse();
searchDailyRecords.recordId = dailyRecord.getRecord().getId();
/* some other info populating record */
response.add(searchDailyRecords);
}
return response;
} catch (Exception e) {
Logger.getLogger(MyService.class.getName()).log(Level.WARNING, null, e);
throw new Exception("Error getting daily records");
}
}
}
PHP 테스트 스크립트
배포 톰캣 서버 로그를 요청하면: 433,210