ok, can you show your client code ?
On 3/22/07, Cobery, Marc (Marc) <[EMAIL PROTECTED]> wrote:
Here is the tcpmon output for a request using my test class:
POST /SOAPRouter/services/SessionIdGeneratorHttpPort HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire
Client +http://xfire.codehaus.org)
Host: 127.0.0.1:9091
Expect: 100-continue
Content-Length: 1100
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<wsse:Security soap:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd"><wsse:UsernameToken
wsu:Id="UsernameToken-8180602"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd"><wsse:Username
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd">other</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-t
oken-profile-1.0#PasswordText"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd">321</wsse:Password></wsse:UsernameToken></wsse:Se
curity></soap:Header><soap:Body><generate
xmlns="http://xml.avaya.com/diamond/wsdl/utils/sessionidgenerator"></gen
erate></soap:Body></soap:Envelope>
25e
<?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>javax.xml.transform.TransformerException:
org.xml.sax.SAXParseException: Content is not allowed in
prolog.</faultstring>
<detail>
<ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">diamondredux</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Here is the tcpmon output from a SOAP UI request:
POST /SOAPRouter/services/SessionIdGeneratorHttpPort HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: 127.0.0.1:9090
Content-Length: 834
<soapenv:Envelope
xmlns:ses="http://xml.avaya.com/diamond/schema/utils/sessionidgenerator"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-9214228"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd">
<wsse:Username>other</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-t
oken-profile-1.0#PasswordText">321</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ses:generate/>
</soapenv:Body>
</soapenv:Envelope>
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=A3B47C5B7544EFFEA6C99E65023A4683;
Path=/SOAPRouter
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 22 Mar 2007 17:44:40 GMT
1bb
<?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>
<ns1:generateResponse
xmlns:ns1="http://xml.avaya.com/diamond/schema/utils/sessionidgenerator"
>
<ns1:sessionId>AAAAACzj6Bk=fL63EA==</ns1:sessionId>
</ns1:generateResponse>
</soapenv:Body>
</soapenv:Envelope>
Any suggestions?
Marc
-----Original Message-----
From: Tomek Sztelak [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 12:00 PM
To: [email protected]
Subject: Re: [xfire-user] Xfire WS-Security
Use https://tcpmon.dev.java.net/ :)
On 3/22/07, Cobery, Marc (Marc) <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,
>
> I am attempting to use the XFire with WS-Security.
>
> I keep getting a Soap fault that is a SAXParseException of Content not
> allowed in prolog. Any suggestions?
>
> I have included the test below, the stacktrace and the Ethereal
> capture 2 requests that are sent to the server.
>
> I am using XFire 1.2.5.
>
> Thanks for any assistance you can provide.
>
> Regards,
> Marc Cobery
>
> Here is my test:
> public void testDynamicSecurity() throws Exception
> {
> Service serviceModel = new
> ObjectServiceFactory().create(SessionIdGenerator.class,
>
> "SessionService",
>
> SERVICE_NAMESPACE,
>
> null);
> SessionIdGenerator service = (SessionIdGenerator) new
> XFireProxyFactory().create(serviceModel,
>
> SERVICE_URL);
>
> Client client =
> ((XFireProxy)Proxy.getInvocationHandler(service)).getClient();
> client.addOutHandler(new DOMOutHandler());
> Properties p = new Properties();
> // Action to perform : user token
> p.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.USERNAME_TOKEN);
> // Set password type to hashed
> p.setProperty(WSHandlerConstants.PASSWORD_TYPE,
> WSConstants.PW_TEXT);
> // Username for WS-Securtiy
> p.setProperty(WSHandlerConstants.USER, USERNAME);
> // Callback class used to retrive password for given user
name
> p.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
> PasswordHandler.class.getName());
> client.addOutHandler(new WSS4JOutHandler(p));
>
> System.out.println("SessionId = " + service.generate());
> }
>
> Here is the stack trace:
> [junit] Testcase: testDynamicSecurity(ws.SessionIdGeneratorTest):
Caused
> an ERROR
> [junit] Could not invoke service.. Nested exception is
> org.codehaus.xfire.fault.XFireFault:
> javax.xml.transform.TransformerEx
>
> ception: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
> [junit] org.codehaus.xfire.XFireRuntimeException: Could not invoke
> service.. Nested exception is org.codehaus.xfire.fault.XFi
>
> reFault: javax.xml.transform.TransformerException:
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> [junit] org.codehaus.xfire.fault.XFireFault:
> javax.xml.transform.TransformerException:
> org.xml.sax.SAXParseException: Content
>
> is not allowed in prolog.
> [junit] at
>
org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSe
rializer.java:31)
> [junit] at
>
org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerial
izer.java:28)
> [junit] at
>
org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHea
dersHandler.java:111)
> [junit] at
>
org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHan
dler.java:67)
> [junit] at
>
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1
31)
> [junit] at
> org.codehaus.xfire.client.Client.onReceive(Client.java:387)
> [junit] at
>
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.
java:139)
> [junit] at
>
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
> [junit] at
>
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java
:26)
> [junit] at
>
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1
31)
> [junit] at
> org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
> [junit] at
> org.codehaus.xfire.client.Client.invoke(Client.java:335)
> [junit] at
> org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
> [junit] at
> org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
> [junit] at $Proxy5.generate(Unknown Source)
> [junit] at
> ws.SessionIdGeneratorTest.testDynamicSecurity(SessionIdGeneratorTest.j
> ava:76)
>
>
> 0000 00 00 5e 00 01 01 00 11 25 48 c8 92 08 00 45 00
..^.....%H....E.
> 0010 01 4e 66 ed 40 00 80 06 27 59 87 23 46 ed 87 23
[EMAIL PROTECTED]'Y.#F..#
> 0020 16 30 05 02 23 82 fd a5 05 87 c6 b1 bd b3 50 18
.0..#.........P.
> 0030 ff ff 6c a4 00 00 50 4f 53 54 20 2f 53 4f 41 50 ..l...POST
/SOAP
> 0040 52 6f 75 74 65 72 2f 73 65 72 76 69 63 65 73 2f
Router/services/
> 0050 53 65 73 73 69 6f 6e 49 64 47 65 6e 65 72 61 74
SessionIdGenerat
> 0060 6f 72 48 74 74 70 50 6f 72 74 20 48 54 54 50 2f orHttpPort
HTTP/
> 0070 31 2e 31 0d 0a 53 4f 41 50 41 63 74 69 6f 6e 3a
1.1..SOAPAction:
> 0080 20 22 22 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70
""..Content-Typ
> 0090 65 3a 20 74 65 78 74 2f 78 6d 6c 3b 20 63 68 61 e: text/xml;
cha
> 00a0 72 73 65 74 3d 55 54 46 2d 38 0d 0a 55 73 65 72
rset=UTF-8..User
> 00b0 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 2f -Agent:
Mozilla/
> 00c0 34 2e 30 20 28 63 6f 6d 70 61 74 69 62 6c 65 3b 4.0
(compatible;
> 00d0 20 4d 53 49 45 20 36 2e 30 3b 20 57 69 6e 64 6f MSIE 6.0;
Windo
> 00e0 77 73 20 4e 54 20 35 2e 30 3b 20 58 46 69 72 65 ws NT 5.0;
XFire
> 00f0 20 43 6c 69 65 6e 74 20 2b 68 74 74 70 3a 2f 2f Client
+http://
> 0100 78 66 69 72 65 2e 63 6f 64 65 68 61 75 73 2e 6f
xfire.codehaus.o
> 0110 72 67 29 0d 0a 48 6f 73 74 3a 20 31 33 35 2e 33 rg)..Host:
135.3
> 0120 35 2e 32 32 2e 34 38 3a 39 30 39 30 0d 0a 45 78
5.22.48:9090..Ex
> 0130 70 65 63 74 3a 20 31 30 30 2d 63 6f 6e 74 69 6e pect:
100-contin
> 0140 75 65 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67
ue..Content-Leng
> 0150 74 68 3a 20 31 31 30 31 0d 0a 0d 0a th: 1101....
>
> 0000 00 00 5e 00 01 01 00 11 25 48 c8 92 08 00 45 00
..^.....%H....E.
> 0010 04 75 69 1f 40 00 80 06 22 00 87 23 46 ed 87 23
[EMAIL PROTECTED]"..#F..#
> 0020 16 30 05 02 23 82 fd a5 06 ad c6 b1 bd b3 50 18
.0..#.........P.
> 0030 ff ff 6f cb 00 00 3c 73 6f 61 70 3a 45 6e 76 65
..o...<soap:Enve
> 0040 6c 6f 70 65 20 78 6d 6c 6e 73 3a 73 6f 61 70 3d lope
xmlns:soap=
> 0050 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e
"http://schemas.
> 0060 78 6d 6c 73 6f 61 70 2e 6f 72 67 2f 73 6f 61 70
xmlsoap.org/soap
> 0070 2f 65 6e 76 65 6c 6f 70 65 2f 22 20 78 6d 6c 6e /envelope/"
xmln
> 0080 73 3a 78 73 64 3d 22 68 74 74 70 3a 2f 2f 77 77
s:xsd="http://ww
> 0090 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31 2f 58 4d
w.w3.org/2001/XM
> 00a0 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 78 LSchema"
xmlns:x
> 00b0 73 69 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77
si="http://www.w
> 00c0 33 2e 6f 72 67 2f 32 30 30 31 2f 58 4d 4c 53 63
3.org/2001/XMLSc
> 00d0 68 65 6d 61 2d 69 6e 73 74 61 6e 63 65 22 3e 0a
hema-instance">.
> 00e0 3c 73 6f 61 70 3a 48 65 61 64 65 72 3e 0a 3c 77
<soap:Header>.<w
> 00f0 73 73 65 3a 53 65 63 75 72 69 74 79 20 73 6f 61 sse:Security
soa
> 0100 70 3a 6d 75 73 74 55 6e 64 65 72 73 74 61 6e 64
p:mustUnderstand
> 0110 3d 22 31 22 20 78 6d 6c 6e 73 3a 77 73 73 65 3d ="1"
xmlns:wsse=
> 0120 22 68 74 74 70 3a 2f 2f 64 6f 63 73 2e 6f 61 73
"http://docs.oas
> 0130 69 73 2d 6f 70 65 6e 2e 6f 72 67 2f 77 73 73 2f
is-open.org/wss/
> 0140 32 30 30 34 2f 30 31 2f 6f 61 73 69 73 2d 32 30
2004/01/oasis-20
> 0150 30 34 30 31 2d 77 73 73 2d 77 73 73 65 63 75 72
0401-wss-wssecur
> 0160 69 74 79 2d 73 65 63 65 78 74 2d 31 2e 30 2e 78
ity-secext-1.0.x
> 0170 73 64 22 3e 3c 77 73 73 65 3a 55 73 65 72 6e 61
sd"><wsse:Userna
> 0180 6d 65 54 6f 6b 65 6e 20 77 73 75 3a 49 64 3d 22 meToken
wsu:Id="
> 0190 55 73 65 72 6e 61 6d 65 54 6f 6b 65 6e 2d 33 32
UsernameToken-32
> 01a0 33 31 36 31 37 31 22 20 78 6d 6c 6e 73 3a 77 73 316171"
xmlns:ws
> 01b0 73 65 3d 22 68 74 74 70 3a 2f 2f 64 6f 63 73 2e
se="http://docs.
> 01c0 6f 61 73 69 73 2d 6f 70 65 6e 2e 6f 72 67 2f 77
oasis-open.org/w
> 01d0 73 73 2f 32 30 30 34 2f 30 31 2f 6f 61 73 69 73
ss/2004/01/oasis
> 01e0 2d 32 30 30 34 30 31 2d 77 73 73 2d 77 73 73 65
-200401-wss-wsse
> 01f0 63 75 72 69 74 79 2d 73 65 63 65 78 74 2d 31 2e
curity-secext-1.
> 0200 30 2e 78 73 64 22 20 78 6d 6c 6e 73 3a 77 73 75 0.xsd"
xmlns:wsu
> 0210 3d 22 68 74 74 70 3a 2f 2f 64 6f 63 73 2e 6f 61
="http://docs.oa
> 0220 73 69 73 2d 6f 70 65 6e 2e 6f 72 67 2f 77 73 73
sis-open.org/wss
> 0230 2f 32 30 30 34 2f 30 31 2f 6f 61 73 69 73 2d 32
/2004/01/oasis-2
> 0240 30 30 34 30 31 2d 77 73 73 2d 77 73 73 65 63 75
00401-wss-wssecu
> 0250 72 69 74 79 2d 75 74 69 6c 69 74 79 2d 31 2e 30
rity-utility-1.0
> 0260 2e 78 73 64 22 3e 3c 77 73 73 65 3a 55 73 65 72
.xsd"><wsse:User
> 0270 6e 61 6d 65 20 78 6d 6c 6e 73 3a 77 73 73 65 3d name
xmlns:wsse=
> 0280 22 68 74 74 70 3a 2f 2f 64 6f 63 73 2e 6f 61 73
"http://docs.oas
> 0290 69 73 2d 6f 70 65 6e 2e 6f 72 67 2f 77 73 73 2f
is-open.org/wss/
> 02a0 32 30 30 34 2f 30 31 2f 6f 61 73 69 73 2d 32 30
2004/01/oasis-20
> 02b0 30 34 30 31 2d 77 73 73 2d 77 73 73 65 63 75 72
0401-wss-wssecur
> 02c0 69 74 79 2d 73 65 63 65 78 74 2d 31 2e 30 2e 78
ity-secext-1.0.x
> 02d0 73 64 22 3e 73 6f 72 63 69 3c 2f 77 73 73 65 3a
sd">other</wsse:
> 02e0 55 73 65 72 6e 61 6d 65 3e 3c 77 73 73 65 3a 50
Username><wsse:P
> 02f0 61 73 73 77 6f 72 64 20 54 79 70 65 3d 22 68 74 assword
Type="ht
> 0300 74 70 3a 2f 2f 64 6f 63 73 2e 6f 61 73 69 73 2d
tp://docs.oasis-
> 0310 6f 70 65 6e 2e 6f 72 67 2f 77 73 73 2f 32 30 30
open.org/wss/200
> 0320 34 2f 30 31 2f 6f 61 73 69 73 2d 32 30 30 34 30
4/01/oasis-20040
> 0330 31 2d 77 73 73 2d 75 73 65 72 6e 61 6d 65 2d 74
1-wss-username-t
> 0340 6f 6b 65 6e 2d 70 72 6f 66 69 6c 65 2d 31 2e 30
oken-profile-1.0
> 0350 23 50 61 73 73 77 6f 72 64 54 65 78 74 22 20 78 #PasswordText"
x
> 0360 6d 6c 6e 73 3a 77 73 73 65 3d 22 68 74 74 70 3a
mlns:wsse="http:
> 0370 2f 2f 64 6f 63 73 2e 6f 61 73 69 73 2d 6f 70 65
//docs.oasis-ope
> 0380 6e 2e 6f 72 67 2f 77 73 73 2f 32 30 30 34 2f 30
n.org/wss/2004/0
> 0390 31 2f 6f 61 73 69 73 2d 32 30 30 34 30 31 2d 77
1/oasis-200401-w
> 03a0 73 73 2d 77 73 73 65 63 75 72 69 74 79 2d 73 65
ss-wssecurity-se
> 03b0 63 65 78 74 2d 31 2e 30 2e 78 73 64 22 3e 31 32
cext-1.0.xsd">32
> 03c0 33 3c 2f 77 73 73 65 3a 50 61 73 73 77 6f 72 64
1</wsse:Password
> 03d0 3e 3c 2f 77 73 73 65 3a 55 73 65 72 6e 61 6d 65
></wsse:Username
> 03e0 54 6f 6b 65 6e 3e 3c 2f 77 73 73 65 3a 53 65 63
Token></wsse:Sec
> 03f0 75 72 69 74 79 3e 3c 2f 73 6f 61 70 3a 48 65 61
urity></soap:Hea
> 0400 64 65 72 3e 3c 73 6f 61 70 3a 42 6f 64 79 3e 3c
der><soap:Body><
> 0410 67 65 6e 65 72 61 74 65 20 78 6d 6c 6e 73 3d 22 generate
xmlns="
> 0420 68 74 74 70 3a 2f 2f 78 6d 6c 2e 61 76 61 79 61
http://xml.avaya
> 0430 2e 63 6f 6d 2f 64 69 61 6d 6f 6e 64 2f 77 73 64
.com/diamond/wsd
> 0440 6c 2f 75 74 69 6c 73 2f 73 65 73 73 69 6f 6e 69
l/utils/sessioni
> 0450 64 67 65 6e 65 72 61 74 6f 72 22 3e 3c 2f 67 65
dgenerator"></ge
> 0460 6e 65 72 61 74 65 3e 3c 2f 73 6f 61 70 3a 42 6f
nerate></soap:Bo
> 0470 64 79 3e 3c 2f 73 6f 61 70 3a 45 6e 76 65 6c 6f
dy></soap:Envelo
> 0480 70 65 3e pe>
--
-----
When one of our products stops working, we'll blame another vendor
within 24 hours.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
--
-----
When one of our products stops working, we'll blame another vendor
within 24 hours.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email