[ptt-users] [TestMaker 4.4] SOAP Protocol Authentication

Frank Cohen fcohen at pushtotest.com
Tue Feb 20 15:10:01 PST 2007


Hi David: The self.protocol.setUsername and setPassword methods are  
the correct way to use SOAP basic authentication. Perhaps there is  
something else wrong. Is the SOAP service available over the public  
Internet? If so, please send it and I will look into it. Otherwise,  
use the Network Monitor and send me a trace of the network  
conversation between TestMaker and the service. Thanks. -Frank




On Feb 8, 2007, at 10:56 AM, Ðavîd Låndïs wrote:

> Hi,
>
> I am trying to test a SOAP over HTTP service that uses Basic  
> authentication. The URL requires a username and password. (If you  
> browse to the URL, you are prompted with a simple authentication box.)
>
> I have modified the "SOAP_Message_Example.py" script to work with  
> my service when authentication is turned off, but now how do I send  
> the username/password? I have tried:
>
> ............
> self.protocol = ProtocolHandler.getProtocol("soap")
> self.protocol.setBody(self.body)
> self.protocol.setUrl("http://localhost:8080/services/DataService ")
> self.protocol.setUsername("user")
> self.protocol.setPassword("password")
> ..........
>
> but the server does not accept this (HTTP error 401). When coding a  
> client in Java I set the user/pass inside the SOAP stub header. So  
> I have also tried to mirror that:
>
> .....
> self.header = SOAPHeader()
> self.header.set("javax.xml.rpc.security.auth.username", "user")
> self.header.set("javax.xml.rpc.security.auth.password", "pass")
> self.protocol.setHeader(self.header)
> ........
>
> but then there is a client error (server never accessed):
>
> java.lang.NullPointerException
>     at com.pushtotest.tool.protocolhandler.SOAPProtocol.soapDocCall  
> (SOAPProtocol.java:467)
>     at com.pushtotest.tool.protocolhandler.SOAPProtocol.connect 
> (SOAPProtocol.java:253)
>     at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke  
> (DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at org.python.core.PyReflectedFunction.__call__ 
> (PyReflectedFunction.java)
>     at org.python.core.PyMethod.__call_ _(PyMethod.java)
>     at org.python.core.PyObject.__call__(PyObject.java:258)
>     at org.python.core.PyInstance.invoke(PyInstance.java)
>     at org.python.pycode._pyx137.runTest$4(<string>:71)
>     at org.python.pycode._pyx137.call_function (<string>)
>     at org.python.core.PyTableCode.call(PyTableCode.java)
>     at org.python.core.PyTableCode.call(PyTableCode.java)
>     at org.python.core.PyFunction.__call__(PyFunction.java)
>     at org.python.core.PyInstance.invoke (PyInstance.java)
>     at org.python.pycode._pyx137.f$0(<string>:120)
>     at org.python.pycode._pyx137.call_function(<string>)
>     at org.python.core.PyTableCode.call(PyTableCode.java)
>     at org.python.core.PyCode.call (PyCode.java)
>     at org.python.core.Py.runCode(Py.java)
>     at org.python.core.Py.exec(Py.java)
>     at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
>     at com.pushtotest.testmaker.gui.AgentRunner.run (Unknown Source)
>
> java.lang.NullPointerException: java.lang.NullPointerException
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users



--
Frank Cohen, PushToTest, http://www.PushToTest.com, phone 408 374 7426
TestMaker: The open-source SOA test automation tool





More information about the Users mailing list