[jboss-user] [JBoss Web Services] New message: "Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: This service requires <wsse:Security>, which is missing."

rinku GARG do-not-reply at jboss.com
Fri Feb 26 06:43:46 EST 2010


User development,

A new message was posted in the thread "Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: This service requires &lt;wsse:Security&gt;, which is missing.":

http://community.jboss.org/message/528745#528745

Author  : rinku GARG
Profile : http://community.jboss.org/people/rinku.garg

Message:
--------------------------------------------------------------
Hi Everybody,
 
I am trying to develop a secured webservice. I am able to deploy the server successfully, but when I run the client then Jboss Server throws the following exception:
 
***********************
Create Web Service Client...
Create Web Service...
Call Web Service Operation...
Exception in thread "main"
 
javax.xml.ws.soap.SOAPFaultException: This service requires <wsse:Security>, which is missing.at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(
 

SOAP11Fault.java:188)at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(
 

SOAPFaultBuilder.java:108)at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(
 

SyncMethodHandler.java:119)at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(
 

SyncMethodHandler.java:89)at com.sun.xml.ws.client.sei.SEIStub.invoke(
 

SEIStub.java:118)at $Proxy26.toCelsius(Unknown Source)
at com.bean.ws.temperature.clientsample.ClientSample.main(ClientSample.java)
 
==========================================================================================================
 
My source code is as given below:
 
1. TempWsBean.java
 
**package
** 
* 
 com.bean.ws.temperature; 
**import
** 
* 
 javax.jws.WebMethod;**import
** 
* 
 javax.jws.WebParam;**import
** 
* 
 javax.jws.WebResult;**import
** 
* 
 javax.jws.WebService;**import
** 
* 
 javax.xml.ws.RequestWrapper;**import
** 
* 
 javax.xml.ws.ResponseWrapper; 
 
 
@WebService
 
(name = "TempWsBean", targetNamespace = "http://temperature.ws.bean.com")
**public
** 
* 
 *interface* TempWsBean { 
 
 
@WebMethod(action = "http://temperature.ws.bean.com/toCelsius") 

@WebResult(name = "returnFahrenheit", targetNamespace = "") 

@RequestWrapper(localName = "toCelsius", targetNamespace = "http://temperature.ws.bean.com", className = "com.bean.ws.temperature.ToCelsius") 

@ResponseWrapper(localName = "toCelsiusResponse", targetNamespace = "http://temperature.ws.bean.com", className = "com.bean.ws.temperature.ToCelsiusResponse") 

 
*public* *float* toCelsius( 

@WebParam(name = "fahrenheit", targetNamespace = "") 

*float* fahrenheit); 
 

 
@WebMethod(action = "http://temperature.ws.bean.com/toFahrenheit") 

@WebResult(name = "returnCelsius", targetNamespace = "") 

@RequestWrapper(localName = "toFahrenheit", targetNamespace = "http://temperature.ws.bean.com", className = "com.bean.ws.temperature.ToFahrenheit") 

@ResponseWrapper(localName = "toFahrenheitResponse", targetNamespace = "http://temperature.ws.bean.com", className = "com.bean.ws.temperature.ToFahrenheitResponse") 

 
*public* *float* toFahrenheit( 

@WebParam(name = "celsius", targetNamespace = "") 

*float* celsius); 
}

 
 
2. TempWsBeanService.java
 
**package
** 
* 
 com.bean.ws.temperature; 
**import
** 
* 
 java.net.MalformedURLException;**import
** 
* 
 java.net.URL;**import
** 
* 
 java.util.logging.Logger; 
**import
** 
* 
 javax.xml.namespace.QName;**import
** 
* 
 javax.xml.ws.Service;**import
** 
* 
 javax.xml.ws.WebEndpoint;**import
** 
* 
 javax.xml.ws.WebServiceClient; 
**import
** 
* 
 org.jboss.ws.annotation.EndpointConfig; 
 
 
@WebServiceClient
 
(name = "TempWsBeanService", targetNamespace = "http://temperature.ws.bean.com", wsdlLocation = "file:/F:/NewGelileoWorkspace/SecureWebService/wsdl/TempWsBeanService.wsdl")
@EndpointConfig
 
(configName ="Standard WSSecurity Endpoint")
* 
*public
** 
* 
 *class* TempWsBeanService 
*extends* Service{
 
 

*private* *final* *static* URL +TEMPWSBEANSERVICE_WSDL_LOCATION+; 

*private* *final* *static* Logger +logger+ = Logger.+getLogger+(com.bean.ws.temperature.TempWsBeanService.*class*.getName()); 
 

*static* {URL url =

*null*; 

*try* {URL baseUrl;
baseUrl = com.bean.ws.temperature.TempWsBeanService.

*class*.getResource(".");url =

*new* URL(baseUrl, "file:/F:/NewGelileoWorkspace/SecureWebService/wsdl/TempWsBeanService.wsdl");}

*catch* (MalformedURLException e) { 

+logger+.warning("Failed to create URL for the wsdl Location: 'file:/F:/NewGelileoWorkspace/SecureWebService/wsdl/TempWsBeanService.wsdl', retrying as a local file"); 

+logger+.warning(e.getMessage());}
 

+TEMPWSBEANSERVICE_WSDL_LOCATION+ = url;}
 
 

*public* TempWsBeanService(URL wsdlLocation, QName serviceName) { 

*super*(wsdlLocation, serviceName);}
 
 

*public* TempWsBeanService() { 

*super*(+TEMPWSBEANSERVICE_WSDL_LOCATION+, *new* QName("http://temperature.ws.bean.com", "TempWsBeanService"));}
 
 

 
 
@WebEndpoint(name = "TempWsBeanPort") 

*public* TempWsBean getTempWsBeanPort() { 

*return* *super*.getPort(*new* QName("http://temperature.ws.bean.com", "TempWsBeanPort"), TempWsBean.*class*);}
 
}

 
******************

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/528745#528745




More information about the jboss-user mailing list