• Post Reply Bookmark Topic Watch Topic
  • New Topic

error while sending a user name token from client

 
gaurav abbi
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,
i'm following this blog and trying to implement web services security
simple ws4j tutorial

after i was able to send a simple request from clent and getting the response successfully, when i tried for sending a request along with a user name token and password i got the following error.

--------------------------------------------------------------------------
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection refused: connect
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:gabbi-dt

java.net.ConnectException: Connection refused: connect
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
ationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
EndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
Context.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
tandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at samples.stock.client.StockWss01SoapBindingStub.getQuote(StockWss01Soa
pBindingStub.java:106)
at samples.stock.client.StockServiceClient.main(StockServiceClient.java:
20)
---------------------------------------------------------------------------

i monitored the soap request and response using tcpmon and everything seems to be fine as far as soap request is concerned
Soap Request:
---------------------------------------------------
POST /axis/services/stock-wss-01 HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 127.0.0.1:22000
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 960

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1"><wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1070904"><wsse:Username>wss4j</wsse:Username><wsse assword Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">dIQwhBQtoGSjNQ8owafoAPZIU8o=</wsse assword><wsse:Nonce>bNfpS3ZXahmWXpOU1XYu0g==</wsse:Nonce><wsu:Created>2007-08-25T14:30:07.488Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header><soapenv:Body><in0 xmlns="http://stock.samples">inf</in0></soapenv:Body></soapenv:Envelope>
---------------------------------------------------------------------------

sorry for this long response but i'm really stuck and not able to proceed at all, also i put SOPs in PWCallback class on server side and its hitting there, but its not calling the service
is there some configuration missing on the server side. Below is the SOAP response:

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Date: Sat, 25 Aug 2007 14:30:09 GMT
Connection: close

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>java.net.ConnectException: Connection refused: connect</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">gabbi-dt</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

please bear with me and see if anybody can help. maybe i can save some part of my weekend
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!