Created
August 25, 2011 17:49
-
-
Save buzain/1171278 to your computer and use it in GitHub Desktop.
Savon SOAPAction http header missing namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==== | |
WSDL | |
==== | |
<?xml version="1.0" encoding="utf-8"?> | |
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://buzain.net/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://buzain.net/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> | |
<wsdl:types> | |
<s:schema elementFormDefault="qualified" targetNamespace="http://buzain.net/"> | |
<s:element name="FloorNumber"> | |
<s:complexType> | |
<s:sequence> | |
<s:element minOccurs="1" maxOccurs="1" name="myNumber" type="s:double" /> | |
</s:sequence> | |
</s:complexType> | |
</s:element> | |
<s:element name="FloorNumberResponse"> | |
<s:complexType> | |
<s:sequence> | |
<s:element minOccurs="1" maxOccurs="1" name="FloorNumberResult" type="s:double" /> | |
</s:sequence> | |
</s:complexType> | |
</s:element> | |
<s:element name="SplitNumber"> | |
<s:complexType> | |
<s:sequence> | |
<s:element minOccurs="1" maxOccurs="1" name="myNumber" type="s:double" /> | |
</s:sequence> | |
</s:complexType> | |
</s:element> | |
<s:element name="SplitNumberResponse"> | |
<s:complexType> | |
<s:sequence> | |
<s:element minOccurs="0" maxOccurs="1" name="SplitNumberResult" type="tns:ArrayOfString" /> | |
</s:sequence> | |
</s:complexType> | |
</s:element> | |
<s:complexType name="ArrayOfString"> | |
<s:sequence> | |
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" /> | |
</s:sequence> | |
</s:complexType> | |
</s:schema> | |
</wsdl:types> | |
<wsdl:message name="FloorNumberSoapIn"> | |
<wsdl:part name="parameters" element="tns:FloorNumber" /> | |
</wsdl:message> | |
<wsdl:message name="FloorNumberSoapOut"> | |
<wsdl:part name="parameters" element="tns:FloorNumberResponse" /> | |
</wsdl:message> | |
<wsdl:message name="SplitNumberSoapIn"> | |
<wsdl:part name="parameters" element="tns:SplitNumber" /> | |
</wsdl:message> | |
<wsdl:message name="SplitNumberSoapOut"> | |
<wsdl:part name="parameters" element="tns:SplitNumberResponse" /> | |
</wsdl:message> | |
<wsdl:portType name="WSForRubySoap"> | |
<wsdl:operation name="FloorNumber"> | |
<wsdl:input message="tns:FloorNumberSoapIn" /> | |
<wsdl:output message="tns:FloorNumberSoapOut" /> | |
</wsdl:operation> | |
<wsdl:operation name="SplitNumber"> | |
<wsdl:input message="tns:SplitNumberSoapIn" /> | |
<wsdl:output message="tns:SplitNumberSoapOut" /> | |
</wsdl:operation> | |
</wsdl:portType> | |
<wsdl:binding name="WSForRubySoap" type="tns:WSForRubySoap"> | |
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> | |
<wsdl:operation name="FloorNumber"> | |
<soap:operation soapAction="http://buzain.net/FloorNumber" style="document" /> | |
<wsdl:input> | |
<soap:body use="literal" /> | |
</wsdl:input> | |
<wsdl:output> | |
<soap:body use="literal" /> | |
</wsdl:output> | |
</wsdl:operation> | |
<wsdl:operation name="SplitNumber"> | |
<soap:operation soapAction="http://buzain.net/SplitNumber" style="document" /> | |
<wsdl:input> | |
<soap:body use="literal" /> | |
</wsdl:input> | |
<wsdl:output> | |
<soap:body use="literal" /> | |
</wsdl:output> | |
</wsdl:operation> | |
</wsdl:binding> | |
<wsdl:binding name="WSForRubySoap12" type="tns:WSForRubySoap"> | |
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> | |
<wsdl:operation name="FloorNumber"> | |
<soap12:operation soapAction="http://buzain.net/FloorNumber" style="document" /> | |
<wsdl:input> | |
<soap12:body use="literal" /> | |
</wsdl:input> | |
<wsdl:output> | |
<soap12:body use="literal" /> | |
</wsdl:output> | |
</wsdl:operation> | |
<wsdl:operation name="SplitNumber"> | |
<soap12:operation soapAction="http://buzain.net/SplitNumber" style="document" /> | |
<wsdl:input> | |
<soap12:body use="literal" /> | |
</wsdl:input> | |
<wsdl:output> | |
<soap12:body use="literal" /> | |
</wsdl:output> | |
</wsdl:operation> | |
</wsdl:binding> | |
<wsdl:service name="WSForRuby"> | |
<wsdl:port name="WSForRubySoap" binding="tns:WSForRubySoap"> | |
<soap:address location="http://buzain-hp:51870/WSForRuby.asmx" /> | |
</wsdl:port> | |
<wsdl:port name="WSForRubySoap12" binding="tns:WSForRubySoap12"> | |
<soap12:address location="http://buzain-hp:51870/WSForRuby.asmx" /> | |
</wsdl:port> | |
</wsdl:service> | |
</wsdl:definitions> | |
========= | |
Ruby code | |
========= | |
#!/usr/bin/env ruby | |
require "rubygems" | |
require "httpi-ntlm" | |
require "savon" | |
require "pp" | |
randNumber = rand(100)-rand() | |
# Configure HTTPI | |
HTTPI.log = false | |
HTTPI.adapter = :curb | |
# Configure Savon | |
Savon.configure do |config| | |
config.log = false # disable logging | |
config.soap_version = 1 # soap 1.1 | |
end | |
client = Savon::Client.new do | |
wsdl.document = "http://buzain-hp:51870/WSForRuby.asmx?wsdl" | |
http.auth.ntlm("username","password") | |
end | |
## Call FloorNumber | |
response = client.request "FloorNumber" do | |
soap.body = { :myNumber => randNumber } | |
# http.headers["SOAPAction"] = '"http://buzain.net/FloorNumber"' | |
end | |
puts "Floored This #{randNumber} to #{response.to_hash[:floor_number_response][\:floor_number_result]}" | |
======================= | |
Savon sent HTTP headers | |
======================= | |
POST /WSForRuby.asmx HTTP/1.1 | |
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABgAGAHAAAAAGAAYAdgAAAAAAAAAAAAAABoKKAkyQRYZNv2sSAAAAAAAAAAAAAAAAAAAAAFFtTVT/kK6L8Woenkf5Zz192zDIWPlyR2J1emFpbm15aG9zdA== | |
Host: buzain-hp:51870 | |
Accept: */* | |
SOAPAction: "FloorNumber" | |
Content-Type: text/xml;charset=UTF-8 | |
Content-Length: 390 | |
============= | |
Error Message | |
============= | |
(soap:Client) Server did not recognize the value of HTTP Header SOAPAction: FloorNumber. (Savon::SOAP::Fault) |
Post your solution here when you fix the problem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the reply
I am doing that already, something else is wrong.