Hi folks, Iam still grappling with my problem, not yet solved. The web service is rightly deployed but on running the client, i keep on getting simpledeserializer error thrown by the server! Any ideas where i might have totally mesed up? Here is how it looks: ------------------------------------ ============== Listen Port: 8081 Target Host: 127.0.0.1 Target Port: 8080 ==== Request ==== POST /axis/services/SecurityTokenService HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.1 Host: 127.0.0.1 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 2611
<?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:RequestSecurityToken ns1:Context="http://context.context" xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/04/trust"><ns1:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3</ns1:TokenType><ns2:TestElement xmlns:ns2="http://testElementNs.testElementNs"/><ns1:Lifetime xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2004-12-03T05:23:33Z</wsu:Created><wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2004-12-03T05:27:43Z</wsu:Expires></ns1:Lifetime><ns1:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</ns1:RequestType><ns1:Base><wsse:UsernameToken xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06"><wsse:Username xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">elly</wsse:Username><wsse:Password Type="PasswordDigest" xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">N5s2wlHwJazdkBNjey9MMpVgDs4=</wsse:Password><wsse:Nonce xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">xn41UC/2Q9elnZaQGnp+GQ==</wsse:Nonce><wsu:Created xmlns:wsu="WSConstants.WSSE_NS_OASIS_2003_06">2004-12-03T05:23:33Z</wsu:Created></wsse:UsernameToken></ns1:Base><ns1:Supporting><wsse:UsernameToken xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06"><wsse:Username xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">martin</wsse:Username><wsse:Password Type="PasswordDigest" xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">rityJY94EkCPN90If83hm1OucmM=</wsse:Password><wsse:Nonce xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">ad49SOIUshIqz0jmt8bTzQ==</wsse:Nonce><wsu:Created xmlns:wsu="WSConstants.WSSE_NS_OASIS_2003_06">2004-12-03T05:23:33Z</wsu:Created></wsse:UsernameToken><wsse:UsernameToken xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06"><wsse:Username xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">alex</wsse:Username><wsse:Password Type="PasswordDigest" xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">1uhSLU1t1+b+NLNZL1ywo7gnphU=</wsse:Password><wsse:Nonce xmlns:wsse="WSConstants.WSSE_NS_OASIS_2003_06">bKg5PaAh0mPtc6cQOnwqUg==</wsse:Nonce><wsu:Created xmlns:wsu="WSConstants.WSSE_NS_OASIS_2003_06">2004-12-03T05:23:33Z</wsu:Created></wsse:UsernameToken></ns1:Supporting></ns1:RequestSecurityToken> </soapenv:Body> </soapenv:Envelope> ==== Response ==== HTTP/1.1 500 Internal Server Error Content-Type: text/xml; charset=utf-8 Date: Fri, 03 Dec 2004 05:23:43 GMT Server: Apache Coyote/1.0 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>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring> <detail/> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> ============== My wsdl file is here too: <wsdl:definitions targetNamespace="http://localhost:8080/axis/services/SecurityTokenService"> - <wsdl:message name="exchangeRequest"> <wsdl:part name="in0" type="xsd:anyType"/> </wsdl:message> - <wsdl:message name="exchangeResponse"> <wsdl:part name="exchangeReturn" type="xsd:anyType"/> </wsdl:message> - <wsdl:portType name="SecurityTokenService"> - <wsdl:operation name="exchange" parameterOrder="in0"> <wsdl:input message="impl:exchangeRequest" name="exchangeRequest"/> <wsdl:output message="impl:exchangeResponse" name="exchangeResponse"/> </wsdl:operation> </wsdl:portType> - <wsdl:binding name="SecurityTokenServiceSoapBinding" type="impl:SecurityTokenService"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="exchange"> <wsdlsoap:operation soapAction=""/> - <wsdl:input name="exchangeRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://implementation.trust2.security.ws.apache.org" use="encoded"/> </wsdl:input> - <wsdl:output name="exchangeResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/SecurityTokenService" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:service name="SecurityTokenServiceService"> - <wsdl:port binding="impl:SecurityTokenServiceSoapBinding" name="SecurityTokenService"> <wsdlsoap:address location="http://localhost:8080/axis/services/SecurityTokenService"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Thanks Kibaya --- David Robison <[EMAIL PROTECTED]> wrote: > I solved my own problem. In the > <web-resource-collection> I needed to > add a <url-pattern> for my SOAP service. I also hade > to modify the > <handler > type="java:org.apache.axis.handlers.SimpleAuthorizationHandler"/> > to > define allowByDefault: as > > <handler > type="java:org.apache.axis.handlers.SimpleAuthorizationHandler"> > <parameter name="allowByDefault" > value="true"/> > </handler> > > David > > David Robison wrote: > > > I have a web service that provides both web pages > via a servlet and > > also SOAP services. I use basic authentication for > the web pages and > > that works fine. I want the SOAP services to use > the same authentication. > > > > I've added the following to my wsdd: > > > > <globalConfiguration> > > <requestFlow> > > <handler > > > type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> > > <handler > > > type="java:org.apache.axis.handlers.SimpleAuthorizationHandler"/> > > <handler > type="java:org.apache.axis.handlers.JWSHandler"> > > <parameter name="scope" > value="session"/> > > </handler> > > <handler > type="java:org.apache.axis.handlers.JWSHandler"> > > <parameter name="scope" > value="request"/> > > <parameter name="extension" > value=".jwr"/> > > </handler> > > <handler type="log"/> > > </requestFlow> > > </globalConfiguration> > > > > I've also set the init-param in the web.xml > > > > <servlet> > > <servlet-name>AxisServlet</servlet-name> > > <display-name>Apache-Axis > Servlet</display-name> > > > > > <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class> > > <init-param> > > > <param-name>use-servlet-security</param-name> > > <param-value>1</param-value> > > > </init-param> </servlet> > > > > And in the same file, I define the security > constraints > > > > <security-constraint> > > <web-resource-collection> > > > <web-resource-name>SecurePages</web-resource-name> > > <description>Security for OpenIMACCS > site</description> > > <url-pattern>*.event</url-pattern> > > <http-method>POST</http-method> > > <http-method>GET</http-method> > > </web-resource-collection> > > > > <auth-constraint> > > <role-name>User</role-name> > > </auth-constraint> > > > > <user-data-constraint> > > <description>SSL not > required</description> > > > <transport-guarantee>NONE</transport-guarantee> > > </user-data-constraint> > > </security-constraint> > > > > <login-config> > > <auth-method>BASIC</auth-method> > > </login-config> > > > > <env-entry> > > <description>JNDI logging context for this > webapp</description> > > > <env-entry-name>log4j/logging-context</env-entry-name> > > > <env-entry-value>OpenIMACCS</env-entry-value> > > > <env-entry-type>java.lang.String</env-entry-type> > > </env-entry> > > > > The realm is defined in the Server.xml as > > > > <Realm > className="org.apache.catalina.realm.JDBCRealm" > debug="99" > > driverName="org.postgresql.Driver" > > > connectionURL="jdbc:postgresql://localhost/OpenIMACCS" > > connectionName="postgres" > connectionPassword="postgres" > > userTable="OpenIMACCS_users" > userNameCol="user_name" > > userCredCol="user_pass" > > userRoleTable="OpenIMACCS_user_roles" > roleNameCol="role_name" /> > > > > However, when I try to call a SOAP service, I get > the following error: > > > > 2964 [Thread-13] DEBUG > org.apache.axis.transport.http.HTTPSender - > > POST /OpenIMACCS/services/MIMOSAReg HTTP/1.0 > > Content-Type: text/xml; charset=utf-8 > > Accept: application/soap+xml, application/dime, > multipart/related, text/* > > User-Agent: Axis/1.2alpha > > Host: localhost:8080 > > Cache-Control: no-cache > > Pragma: no-cache > > SOAPAction: "" > > Content-Length: 734 > > Authorization: Basic RGF2aWQ6Q29yaW5uZQ== > > > > null > > 2974 [Thread-13] DEBUG > org.apache.axis.transport.http.HTTPSender - > > HTTP/1.1 401 Unauthorized > > 2974 [Thread-13] DEBUG > org.apache.axis.transport.http.HTTPSender - > > WWW-Authenticate Basic realm="AXIS" > > > > > > It appears that the realm AXIS is incorrect. Am I > reading it right? > > Any thoughts and ideas? > > Thansk, > > David Robison > > > > -- > > David R Robison > Open Roads Consulting, Inc. > 708 S. Battlefield Blvd., Chesapeake, VA 23322 > phone: (757) 546-3401 > e-mail: [EMAIL PROTECTED] > web: http://openroadsconsulting.com > blog: http://therobe.blogspot.com > > > ===== KIBAYA ERISANIA Msc. Computer Science Hunan University, Yuelushan, Changsha, Hunan 410082 P.R China Tel:0086 731 8649349 Mob: 0086 13975103460 E-Mial: [EMAIL PROTECTED] http://www.ekibs.psend.com Sites of interest http://groups.yahoo.com/group/usac/ http://www.ugandaobserver.com __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo