2013-02-21 184 views
1

我已經設置了一個基本的Webservice(代碼如下)。然後我生成了WSDL文件(右鍵單擊 - >生成WSDL) 不幸的是,SoapAction是空的。有什麼建議? 我已經加了@WebService(name =「testService」,targetNamespace =「test.test/webService」)因爲剛纔@WebService我認爲這會有所幫助 - 我想我錯了...非常惱人的bug(或人類的愚蠢^^)生成的WSDL文件爲空

Tst289374.java:

package com.test; 

import javax.jws.*; 
import javax.jws.soap.SOAPBinding; 


@WebService(name = "testService", targetNamespace = "test.test/webService") 
public class Tst289374 { 

    @WebMethod 
    public void hello() { 
    } 
} 

WSDL:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.6hudson-86 svn-revision#12773. --> 
<definitions targetNamespace="http://test.com/" name="Tst289374Service" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://test.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
    <types> 
    <xsd:schema> 
     <xsd:import namespace="http://test.com/" schemaLocation="Tst289374Service_schema1.xsd"/> 
    </xsd:schema> 
    </types> 
    <message name="hello"> 
    <part name="parameters" element="tns:hello"/> 
    </message> 
    <message name="helloResponse"> 
    <part name="parameters" element="tns:helloResponse"/> 
    </message> 
    <portType name="Tst289374"> 
    <operation name="hello"> 
     <input wsam:Action="http://test.com/Tst289374/helloRequest" message="tns:hello"/> 
     <output wsam:Action="http://test.com/Tst289374/helloResponse" message="tns:helloResponse"/> 
    </operation> 
    </portType> 
    <binding name="Tst289374PortBinding" type="tns:Tst289374"> 
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> 
    <operation name="hello"> 
     **<soap:operation soapAction=""/>** 
     <input> 
     <soap:body use="literal"/> 
     </input> 
     <output> 
     <soap:body use="literal"/> 
     </output> 
    </operation> 
    </binding> 
    <service name="Tst289374Service"> 
    <port name="Tst289374Port" binding="tns:Tst289374PortBinding"> 
     <soap:address location="REPLACE_WITH_ACTUAL_URL"/> 
    </port> 
    </service> 
</definitions> 

編輯:另外,不正確的點擊生成的WSDL文件母鹿不包含肥皂行動。

回答