I am trying to test a web service and I am unadble to get the security
header in the envelope. Below is an example of the soap envelope I am
trying to create followed by an example of the code I have written and
what the service is returning

Example Soap envelope:.

<soapenv:Envelope xmlns:ser="http://server.domain.com/";
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-wssecurity-
secext-1.0.xsd">
         <wsu:Timestamp wsu:Id="Timestamp-17852335" xmlns:wsu="http://
docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-
utility-1.0.xsd">
            <wsu:Created>2009-04-14T15:10:12Z</wsu:Created>
            <wsu:Expires>2009-04-14T15:15:12Z</wsu:Expires>
         </wsu:Timestamp>
         <wsse:UsernameToken wsu:Id="UsernameToken-12478552"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
wssecurity-utility-1.0.xsd">
            <wsse:Username>wball</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/
2004/01/oasis-200401-wss-username-token-
profile-1.0#PasswordText">wball</wsse:Password>
            <wsse:Nonce>VpJSJ78ArCIR4sWMbmSKJA==</wsse:Nonce>
            <wsu:Created>2009-04-14T15:10:12.562Z</wsu:Created>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <ser:findCustomersByMacAddress>
         <!--Optional:-->
         <macAddress>00:A0:BC:07:56:DC</macAddress>
      </ser:findCustomersByMacAddress>
   </soapenv:Body>
</soapenv:Envelope>

Example of my code:

require 'soap/wsdlDriver'
require "soap/rpc/driver"


URL = "http://something.something.something.net:7771/WebServices/
services/CustomerSearch?wsdl"

factory = SOAP::WSDLDriverFactory.new(URL)
driver = factory.create_rpc_driver
driver.wiredump_dev =  STDERR

begin

 result = driver.findCustomersByName("Eric"),("Morris")
 puts result




end




Response from Service:

Wire dump:

= Request

! CONNECT TO something.something.something.net:7771
! CONNECTION ESTABLISHED
POST /WebServices/services/CustomerSearch HTTP/1.1

SOAPAction: "urn:findCustomersByName"

Content-Type: text/xml; charset=utf-8

User-Agent: SOAP4R/1.5.5 (httpclient.rb/269, ruby 1.8.6 (2007-09-24)
[i386-mswin32])

Date: Tue, 14 Apr 2009 18:48:57 GMT

Content-Length: 369

Host: somethign.something.something.net:7771



<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <env:Body>
    <n1:findCustomersByName xmlns:n1="http://
services.webservice.something.com/">
    </n1:findCustomersByName>
  </env:Body>
</env:Envelope>

= Response

HTTP/1.1 500 Internal Server Error

Date: Tue, 14 Apr 2009 18:48:58 GMT

Transfer-Encoding: chunked

Content-Type: text/xml; charset=UTF-8

X-Powered-By: Servlet/2.4 JSP/2.0



00f5

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</
faultcode><faultstring>Request does not contain required Security
header.</faultstring></soap:Fault></soap:Body></soap:Envelope>

0000



! CONNECTION CLOSED


: Request does not contain required Security header.
(SOAP::FaultError)
>Exit code: 1


Any help would be greatly appreciated,

Eric Morris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to