這裏是生成WSDL我的Java代碼:@WebMethod(action = "sendRequest") @WebResult(partName= "message") public String addRequest(@WebParam(partName = "firstName") String firstName, @WebParam(partName = "lastName") String lastName, @WebParam(partName = "jmbg") long jmbg, @WebParam(partName = "dateTime") Date dateTime) { try { appointmentManager.getAppointmentRequest().add(new AppointmentRequest(firstName, lastName, jmbg, dateTime)); return "Central office is closed due to the reconstruction. It will reopen on Monday."; } catch (Exception e) { return "Wrong format"; } }
賈克斯WS @WebParam(零件名稱)不工作
這裏是我生成的WSDL中產生的複雜類型:<xs:complexType name="addRequest"> <xs:sequence> <xs:element minOccurs="0" name="arg0" type="xs:string"/> <xs:element minOccurs="0" name="arg1" type="xs:string"/> <xs:element name="arg2" type="xs:long"/> <xs:element minOccurs="0" name="arg3" type="xs:dateTime"/> </xs:sequence> </xs:complexType>
正如你所看到的。輸入參數被稱爲arg0,arg1,arg2,arg3,而不是在註釋中指定的名稱。