You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Emanuel Haisiuc <em...@gmail.com> on 2005/05/24 14:56:05 UTC
Setting the username token dynamically at runtime
Hello!
I'm a newbie with WSS4J. I'm going through the first tutorial, and I'm
trying to set the username token at runtime.
I've generated the stubs with WSDL2Java. Attached are the 2 classes I've
made, beside the generated classes and interfaces. I'm trying to connect
to the StockQuoteService web service. Running the example with external
config file works fine. But running the client using the dynamical
setting of the username return the following message:
Exception in thread "main" AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: WSDoAllReceiver: Request does not contain required
Security header
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:manu.rogrid.pub.ro
WSDoAllReceiver: Request does not contain required Security header
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at
samples.stock.client.StockWss01SoapBindingStub.getQuote(StockWss01SoapBindingStub.java:106)
at
samples.stock.client.StockServiceClient.main(StockServiceClient.java:61)
Can anyone help me?
Thank you a lot!
Best regards,
Emanuel Haisiuc
Re: Setting the username token dynamically at runtime
Posted by Ashok Shah <as...@sfu.ca>.
It looks like the WSDoAllReciever got the SOAP request and tried to
process the security header, but the request didnt have any security
header.
Make sure you deploy client side so that the WSDoAllSender is called to
add the security header. Also you didnt specify the action property.
Cheers,
--as
On Tue, 24 May 2005 15:56:05 +0300, Emanuel Haisiuc
<em...@gmail.com> wrote:
> Hello!
>
> I'm a newbie with WSS4J. I'm going through the first tutorial, and I'm
> trying to set the username token at runtime.
>
> I've generated the stubs with WSDL2Java. Attached are the 2 classes I've
> made, beside the generated classes and interfaces. I'm trying to connect
> to the StockQuoteService web service. Running the example with external
> config file works fine. But running the client using the dynamical
> setting of the username return the following message:
>
> Exception in thread "main" AxisFault
> faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
> faultSubcode:
> faultString: WSDoAllReceiver: Request does not contain required
> Security header
> faultActor:
> faultNode:
> faultDetail:
> {http://xml.apache.org/axis/}hostname:manu.rogrid.pub.ro
>
> WSDoAllReceiver: Request does not contain required Security header
> at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
> at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
> at
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
> at
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
> at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> at
> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> at org.apache.axis.client.Call.invoke(Call.java:2748)
> at org.apache.axis.client.Call.invoke(Call.java:2424)
> at org.apache.axis.client.Call.invoke(Call.java:2347)
> at org.apache.axis.client.Call.invoke(Call.java:1804)
> at
> samples.stock.client.StockWss01SoapBindingStub.getQuote(StockWss01SoapBindingStub.java:106)
> at
> samples.stock.client.StockServiceClient.main(StockServiceClient.java:61)
>
> Can anyone help me?
>
> Thank you a lot!
>
> Best regards,
> Emanuel Haisiuc
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/