你用什么发布的?aix2?xfire?或者weblogic或者....!你这样问问题谁能回答你啊! 把你的代码程序,用什么发布的都贴出来! 否则没人可以答出你的问题除非是神仙!
解决方案 »
- JDBC连接MSSQL2008 没反应 不报错 急急急在线等!
- 求一个java B/S模式管理系统源码
- 一个JMS的问题?
- 求助答案
- 求助,怎样配置xfire,使其发布的webservice可以直接被http请求访问啊?
- 版主们,,,求命呀,我发的贴没人解决得了呀
- javamail奇怪的问题!
- 谁能解释一下邮件服务器是如何发送邮件的?
- java.lang.NoSuchMethodError: main,Exception in thread "main"是什么错误??
- java.sql.SQLException: 求助,弄了大半天
- 如何用JAVA控制WORD,跪求高手解答
- Hibernate与数据库Informix的问题提,请达人解答!
package provider1;
import wroxinsurance.Appointment;
import java.io.StringReader;import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
import org.jdom.output.Format;public class Provider1Appointment implements Appointment
{
public Provider1Appointment()
{
}
public String getProviderDetails()
{
Element ProviderDetailsRoot = new Element("PROVIDER-DETAILS");
ProviderDetailsRoot.setAttribute("PROVIDER","1");
ProviderDetailsRoot.addContent(new Element("NAME").setText("PROVIDER 1"));
ProviderDetailsRoot.addContent(new Element("ADDR1").setText("123 STREET"));
ProviderDetailsRoot.addContent(new Element("ADDR2").setText("SUITE 100"));
ProviderDetailsRoot.addContent(new Element("CITY").setText("SAN JOSE"));
ProviderDetailsRoot.addContent(new Element("SATAE").setText("CA"));
Document ProviderDetails=new Document(ProviderDetailsRoot);
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
return outputter.outputString(ProviderDetails);
}
public String getAppointmentSlots(String inputReq)
{
Element AppointmentsRoot = new Element("PROVIDER-APPOINTMENTS");
AppointmentsRoot.setAttribute("PROVIDER","1");
//Appointment1
Element Appointment1 = new Element("APPOINTMENT");
Appointment1.setAttribute("ID","A-1000");
Appointment1.addContent(new Element("DATE").setText("1 NOV 2001"));
Appointment1.addContent(new Element("TIME").setText("11:00 AM"));
Document AppointmentSlots = new Document(AppointmentsRoot);
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
return outputter.outputString(AppointmentSlots);
}
public String reserveAppointment(String inputReq)
{
System.out.println("Received Appointment");
System.out.println("~~~~~~~~~~~~~~~~~~~~");
try
{
SAXBuilder builder = new SAXBuilder();
Document AppointmentReq = builder.build(new StringReader(inputReq));
Element AppointmentReqRoot = AppointmentReq.getRootElement();
String providerId = AppointmentReqRoot.getAttribute("PROVIDERID").getValue();
String patientId = AppointmentReqRoot.getChild("PATIENTID").getText();
String apptId = AppointmentReqRoot.getChild("APPOINTMNET-ID").getText();
Element AppointmentRespRoot = new Element("PROVIDER-APPOINTMENTRESPONSE");
AppointmentRespRoot.setAttribute("PROVIDERID","1");
AppointmentRespRoot.addContent(new Element("PATIENTID").setText("patientId"));
AppointmentRespRoot.addContent(new Element("APPOINTMNET-ID").setText("apptId"));
AppointmentRespRoot.addContent(new Element("STATUS").setText("OK"));
Document AppointmentResponse = new Document(AppointmentRespRoot);
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
return outputter.outputString(AppointmentResponse);
}
catch (Exception e)
{
System.out.println("error");
return "ERROR";
}
}
}
用wsdd,如下:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="urn:provider" provider="java:RPC">
<parameter name="className" value="Provider1Appointment"/>
<parameter name="allowedMethods" value="*"/>
</service>
<requestFlow>
<handler type="soapmonitor"/>
</requestFlow>
<responseFlow>
<handler type="soapmonitor"/>
</responseFlow>
</deployment>
发布成功了,就是<Admin>done<Admin>
但是axis的view中却什么也没有了,只有最上面一行:and now~~~~~some services请各位高手支罩