2013-06-25 65 views
0

我在jdeveloper 10.1.3中開發了一個.war文件。我想將它部署在獨立服務器的glassfish4.0服務器上。在jdeveloper上部署.war開發的glassfish4.0

首先我寫Java代碼

package com.oi.testdemohello; 

public class TestHello { 
    public TestHello() { 
    } 

    public String sayHello(String name){ 
     return "Hello "+name; 
    } 
} 

比我在JDeveloper中創建一個J2EE1.4(JAX-RPC)和SOAP 1.1綁定的Web服務從代碼,有狀態的服務。

的WSDL生成的是:

<definitions 
    name="MyWebService" 
    targetNamespace="http://testdemohello.oi.com/" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:tns="http://testdemohello.oi.com/" 
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
    xmlns:tns0="http://testdemohello.oi.com/types/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> 
<types> 
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://testdemohello.oi.com/types/" 
     elementFormDefault="qualified" xmlns:tns="http://testdemohello.oi.com/types/" 
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"> 

     <element name="sayHelloElement"> 
      <complexType> 
       <sequence> 
        <element name="name" type="string" nillable="true"/> 
       </sequence> 
      </complexType> 
     </element> 
     <element name="sayHelloResponseElement"> 
      <complexType> 
       <sequence> 
        <element name="result" type="string" nillable="true"/> 
       </sequence> 
      </complexType> 
     </element> 
    </schema> 
</types> 
<message name="MyWebService_sayHello"> 
    <part name="parameters" element="tns0:sayHelloElement"/> 
</message> 
<message name="MyWebService_sayHelloResponse"> 
    <part name="parameters" element="tns0:sayHelloResponseElement"/> 
</message> 
<portType name="MyWebService"> 
    <operation name="sayHello"> 
     <input message="tns:MyWebService_sayHello"/> 
     <output message="tns:MyWebService_sayHelloResponse"/> 
    </operation> 
</portType> 
<binding name="MyWebServiceSoapHttp" type="tns:MyWebService"> 
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
    <operation name="sayHello"> 
     <soap:operation soapAction="http://testdemohello.oi.com//sayHello"/> 
     <input> 
      <soap:body use="literal"/> 
     </input> 
     <output> 
      <soap:body use="literal"/> 
     </output> 
    </operation> 
</binding> 
<service name="MyWebService"> 
    <port name="MyWebServiceSoapHttpPort" binding="tns:MyWebServiceSoapHttp"> 
     <soap:address location="http://localMachine3:8888/TestDemoHello-DemoHello-context-root/MyWebServiceSoapHttpPort"/> 
    </port> 
</service> 

比我部署的這個.war文件。

現在我想將這個.war文件部署到glassfish 4.0服務器。但我無法做到。如何做到這一點,請建議我。

回答