你用什么发布的?aix2?xfire?或者weblogic或者....!你这样问问题谁能回答你啊! 把你的代码程序,用什么发布的都贴出来! 否则没人可以答出你的问题除非是神仙!

解决方案 »

  1.   

    我用axis发布的,以下发布的JAVA文件.
    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请各位高手支罩