# Wsdl2ruby request invalid while soapui's is correct

**URL:** <https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346>\
**Category:** ruby-talk\
**Created:** [29 September 2008 02:10 UTC](https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346 "2008-09-29T02:10:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Grey](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@Lee\_Grey](https://rubytalk.org/u/Lee_Grey)\
**Post date:** [29 September 2008 02:10 UTC](https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346/1 "2008-09-29T02:10:40Z")

</div>

[Apologies if this ends up being a duplicate post. I've been waiting for  
over three hours for my post to appear, so I'm wondering if there is a  
problem between Nabble and this list.]

I'm trying to use wsdl2ruby with the optionsXpress web services. The WSDL  
can be retrieved at  
[https://oxbranch.optionsxpress.com/accountservice/account.asmx?WSDL](https://oxbranch.optionsxpress.com/accountservice/account.asmx?WSDL).

In SOAPUI, the generated raw request looks like this:

Content-Length: 468  
Host: [oxbranch.optionsxpress.com](http://oxbranch.optionsxpress.com)  
User-Agent: Jakarta Commons-HttpClient/3.0.1  
SOAPAction: "[http://oxbranch.optionsxpress.com/GetOxSessionWithSource](http://oxbranch.optionsxpress.com/GetOxSessionWithSource)"  
Content-Type: text/xml;charset=UTF-8

\<soapenv:Envelope xmlns:soapenv="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"  
xmlns:oxb="[http://oxbranch.optionsxpress.com](http://oxbranch.optionsxpress.com)"\>  
&nbsp;&nbsp;&nbsp;\<soapenv:Header/\>  
&nbsp;&nbsp;&nbsp;\<soapenv:Body\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:GetOxSessionWithSource\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sUserName\>?\</oxb:sUserName\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sPassword\>?\</oxb:sPassword\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sSessionID\>?\</oxb:sSessionID\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sSource\>?\</oxb:sSource\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</oxb:GetOxSessionWithSource\>  
&nbsp;&nbsp;&nbsp;\</soapenv:Body\>  
\</soapenv:Envelope\>

The wiredump from soap4r request looks like this (after my  
clean-up/reformatting):

POST /accountservice/account.asmx/GetOxSessionWithSource HTTP/1.1  
Content-Type: text/xml; charset=utf-8  
Soapaction: \"[http://oxbranch.optionsxpress.com/GetOxSessionWithSource&quot;](http://oxbranch.optionsxpress.com/GetOxSessionWithSource&quot;)  
User-Agent: SOAP4R/1.5.5  
Accept: \*/\*  
Host: [oxbranch.optionsxpress.com](http://oxbranch.optionsxpress.com)  
Content-Length: 510

\<?xml version=\"1.0\" encoding=\"utf-8\" ?\>  
\<env:Envelope xmlns:xsi=\"[http://www.w3.org/2001/XMLSchema-instance&quot;](http://www.w3.org/2001/XMLSchema-instance&quot;)  
&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsd=\"[http://www.w3.org/2001/XMLSchema&quot;](http://www.w3.org/2001/XMLSchema&quot;)  
&nbsp;&nbsp;&nbsp;&nbsp;xmlns:env=\"[http://schemas.xmlsoap.org/soap/envelope/&quot;](http://schemas.xmlsoap.org/soap/envelope/&quot;)\>  
&nbsp;&nbsp;\<env:Body\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<GetOxSessionWithSource xmlns=\"[http://oxbranch.optionsxpress.com](http://oxbranch.optionsxpress.com)&quot;\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<sUserName\>\</sUserName\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<sPassword\>\</sPassword\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<sSessionID\>\</sSessionID\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<sSource\>\</sSource\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</GetOxSessionWithSource\>  
&nbsp;&nbsp;\</env:Body\>  
\</env:Envelope\>

The call from SOAPUI works perfectly. The soap4r call results in the  
following response:

-\> "HTTP/1.1 500 Internal Server Error\r\n"  
-\> "Cache-Control: private\r\n"  
-\> "Content-Length: 236\r\n"  
-\> "Content-Type: text/plain; charset=utf-8\r\n"  
-\> "Server: Microsoft-IIS/6.0\r\n"  
-\> "X-Powered-By: [ASP.NET](http://ASP.NET)\r\n"  
-\> "X-AspNet-Version: 2.0.50727\r\n"  
-\> "Set-Cookie: TLTHID=B1B3C4E642E7B78CBAB2CF8EB944A39C; Path=/; Domain=.  
[optionsxpress.com](http://optionsxpress.com)\r\n"  
-\> "Set-Cookie: TLTSID=B1B3C4E642E7B78CBAB2CF8EB944A39C; Path=/; Domain=.  
[optionsxpress.com](http://optionsxpress.com)\r\n"  
-\> "HostName: DABRANCH1\r\n"  
-\> "Set-Cookie: TLTCNT=DABRANCH10000000000140155\r\n"  
-\> "Date: Sun, 28 Sep 2008 21:39:30 GMT\r\n"  
-\> "\r\n"  
reading 236 bytes...  
-\> "System.InvalidOperationException: Request format is invalid: text/xml;  
charset=utf-8.\r\n at  
System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()\r\n at  
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest  
()\r\n"  
read 236 bytes  
Conn keep-alive  
System.InvalidOperationException: Request format is invalid: text/xml;  
charset=utf-8.

> **···**
>
> at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() I'm not sure, but it looks like the "\<?xml..." prolog could be the problem. The namespaces seem the same. I don't understand why the server says  
> request format text/xml is invalid; that's what SOAPUI is sending.
> 
> I'm new to soap4r. Can anyone with some experience give me a clue what's  
> going on and what to do about it, please? I've been spinning my wheels on  
> this for longer than I care to admit.
> 
> Where are the docs??? If I could just suppress the xml prolog, maybe I  
> could get past this.
> 
> Thanks,  
> Lee Grey
> 
> > **[JCranky - Lee Grey](http://leegrey.com/hmm/)**
> >
> > The New and Improved Blog of Lee Grey nee JCranky

---

<div class="post-metadata">

**Author:** ![Mark\_Thomas](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@Mark\_Thomas](https://rubytalk.org/u/Mark_Thomas)\
**Post date:** [29 September 2008 14:24 UTC](https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346/2 "2008-09-29T14:24:15Z")

</div>

Version 1.5.5 is broken. Please install version 1.5.8 and try again.

-- Mark.

> **···**
>
> On Sep 28, 10:10 pm, Lee Grey \<nab...@leegrey.com\> wrote:
> 
> > The wiredump from soap4r request looks like this (after my  
> > clean-up/reformatting):
> > 
> > POST /accountservice/account.asmx/GetOxSessionWithSource HTTP/1.1  
> > Content-Type: text/xml; charset=utf-8  
> > Soapaction: \"[http://oxbranch.optionsxpress.com/GetOxSessionWithSource\&quot](http://oxbranch.optionsxpress.com/GetOxSessionWithSource%5C&quot);  
> > User-Agent: SOAP4R/1.5.5

---

<div class="post-metadata">

**Author:** ![Lee\_Grey](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@Lee\_Grey](https://rubytalk.org/u/Lee_Grey)\
**Post date:** [29 September 2008 15:31 UTC](https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346/3 "2008-09-29T15:31:08Z")

</div>

I'm confused by what seems to be a conflict in JRuby. If I'm reading things  
right (I'm fairly green with Ruby, so I may not be reading it right), I have  
soap4r 1.5.5 installed in JRuby 1.1.4 but soap4r gem 1.5.8 installed, as  
well.

How do I run with the gem rather than the stuff in the JRuby library?

Thanks,  
Lee

Mark Thomas-5 wrote:

> **···**
>
> > On Sep 28, 10:10 pm, Lee Grey \<nab...@leegrey.com\> wrote:
> > 
> > > The wiredump from soap4r request looks like this (after my  
> > > clean-up/reformatting):
> > > 
> > > POST /accountservice/account.asmx/GetOxSessionWithSource HTTP/1.1  
> > > Content-Type: text/xml; charset=utf-8  
> > > Soapaction: \"[http://oxbranch.optionsxpress.com/GetOxSessionWithSource\&quot](http://oxbranch.optionsxpress.com/GetOxSessionWithSource%5C&quot);  
> > > User-Agent: SOAP4R/1.5.5
> > 
> > Version 1.5.5 is broken. Please install version 1.5.8 and try again.
> > 
> > -- Mark.
> 
> --  
> View this message in context: [http://www.nabble.com/wsdl2ruby-request-invalid-while-soapui's-is-correct-tp19717554p19726137.html](http://www.nabble.com/wsdl2ruby-request-invalid-while-soapui%27s-is-correct-tp19717554p19726137.html)  
> Sent from the ruby-talk mailing list archive at Nabble.com.

---

<div class="post-metadata">

**Author:** ![Lee\_Grey](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@Lee\_Grey](https://rubytalk.org/u/Lee_Grey)\
**Post date:** [4 October 2008 01:54 UTC](https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346/4 "2008-10-04T01:54:14Z")

</div>

The problem still appears with 1.5.8. Here is my request:

POST /accountservice/account.asmx/GetOxSessionWithSource HTTP/1.1  
Content-Type: text/xml; charset=utf-8  
Soapaction: "[http://oxbranch.optionsxpress.com/GetOxSessionWithSource&quot](http://oxbranch.optionsxpress.com/GetOxSessionWithSource&quot);  
User-Agent: SOAP4R/1.5.8  
Accept: \*/\*  
Host: oxbranch.optionsxpress.com  
Content-Length: 543

\<?xml version="1.0" encoding="utf-8" ?\>  
\<env:Envelope xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance&quot](http://www.w3.org/2001/XMLSchema-instance&quot);  
&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsd="[http://www.w3.org/2001/XMLSchema&quot](http://www.w3.org/2001/XMLSchema&quot);  
&nbsp;&nbsp;&nbsp;&nbsp;xmlns:env="[Error](http://schemas.xmlsoap.org/soap/envelope/&quot;&gt);  
&nbsp;&nbsp;\<env:Body\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<n1:GetOxSessionWithSource xmlns:n1="[http://oxbranch.optionsxpress.com](http://oxbranch.optionsxpress.com)"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<n1:sUserName\>\</n1:sUserName\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<n1:sPassword\>\</n1:sPassword\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<n1:sSessionID\>\</n1:sSessionID\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<n1:sSource\>\</n1:sSource\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</n1:GetOxSessionWithSource\>  
&nbsp;&nbsp;\</env:Body\>  
\</env:Envelope\>

And the response is:

HTTP/1.1 500 Internal Server Error  
Cache-Control: private  
Content-Length: 236  
Content-Type: text/plain; charset=utf-8  
Server: Microsoft-IIS/6.0  
X-Powered-By: ASP.NET  
X-AspNet-Version: 2.0.50727  
Set-Cookie: TLTHID=6D076B6B48711349484380840CF90FF8; Path=/;  
Domain=.optionsxpress.com  
Set-Cookie: TLTSID=6D076B6B48711349484380840CF90FF8; Path=/;  
Domain=.optionsxpress.com  
HostName: EQBRANCH3  
Set-Cookie: TLTCNT=EQBRANCH30000000000814400

System.InvalidOperationException: Request format is invalid: text/xml;  
charset=utf-8.  
&nbsp;&nbsp;&nbsp;at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()  
&nbsp;&nbsp;&nbsp;at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()  
...........c

And it still works fine with SOAPUI, where the request looks like this:

POST /accountservice/account.asmx HTTP/1.1  
Content-Type: text/xml;charset=UTF-8  
SOAPAction: "[http://oxbranch.optionsxpress.com/GetOxSessionWithSource&quot](http://oxbranch.optionsxpress.com/GetOxSessionWithSource&quot);  
User-Agent: Jakarta Commons-HttpClient/3.0.1  
Host: oxbranch.optionsxpress.com  
Content-Length: 458

\<soapenv:Envelope xmlns:soapenv="[Error](http://schemas.xmlsoap.org/soap/envelope/&quot);  
xmlns:oxb="[http://oxbranch.optionsxpress.com](http://oxbranch.optionsxpress.com)"\>  
&nbsp;&nbsp;&nbsp;\<soapenv:Header/\>  
&nbsp;&nbsp;&nbsp;\<soapenv:Body\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:GetOxSessionWithSource\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sUserName\>\</oxb:sUserName\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sPassword\>\</oxb:sPassword\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sSessionID\>\</oxb:sSessionID\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<oxb:sSource\>\</oxb:sSource\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</oxb:GetOxSessionWithSource\>  
&nbsp;&nbsp;&nbsp;\</soapenv:Body\>  
\</soapenv:Envelope\>

Any ideas?

Thanks for any leads!

--Lee

Mark Thomas-5 wrote:

> **···**
>
> Date: Sat, 04 Oct 2008 01:49:11 GMT
> 
> > On Sep 28, 10:10 pm, Lee Grey \<nab...@leegrey.com\> wrote:
> > 
> > > The wiredump from soap4r request looks like this (after my  
> > > clean-up/reformatting):
> > > 
> > > POST /accountservice/account.asmx/GetOxSessionWithSource HTTP/1.1  
> > > Content-Type: text/xml; charset=utf-8  
> > > Soapaction: \"[http://oxbranch.optionsxpress.com/GetOxSessionWithSource\&quot](http://oxbranch.optionsxpress.com/GetOxSessionWithSource%5C&quot);  
> > > User-Agent: SOAP4R/1.5.5
> > 
> > Version 1.5.5 is broken. Please install version 1.5.8 and try again.
> > 
> > -- Mark.
> 
> --  
> View this message in context: [http://www.nabble.com/wsdl2ruby-request-invalid-while-soapui's-is-correct-tp19717554p19808348.html](http://www.nabble.com/wsdl2ruby-request-invalid-while-soapui%27s-is-correct-tp19717554p19808348.html)  
> Sent from the ruby-talk mailing list archive at Nabble.com.

---

<div class="post-metadata">

**Author:** ![Lee\_Grey](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@Lee\_Grey](https://rubytalk.org/u/Lee_Grey)\
**Post date:** [29 September 2008 19:47 UTC](https://rubytalk.org/t/wsdl2ruby-request-invalid-while-soapuis-is-correct/49346/5 "2008-09-29T19:47:30Z")

</div>

Maybe I should ask this another way:

How do I update my Ruby library to include the latest copy of soap4r? I  
have no experience with maintaining the underlying Ruby platform; I'm just a  
user at this point.

Thanks,  
Lee

> **···**
>
> On Mon, Sep 29, 2008 at 11:31 AM, nabblee \<nabble@leegrey.com\> wrote:
> 
> > I'm confused by what seems to be a conflict in JRuby. If I'm reading things  
> > right (I'm fairly green with Ruby, so I may not be reading it right), I  
> > have  
> > soap4r 1.5.5 installed in JRuby 1.1.4 but soap4r gem 1.5.8 installed, as  
> > well.
> > 
> > How do I run with the gem rather than the stuff in the JRuby library?
> > 
> > Thanks,  
> > Lee
> > 
> > Mark Thomas-5 wrote:  
> > \>  
> > \> On Sep 28, 10:10 pm, Lee Grey \<nab...@leegrey.com\> wrote:  
> > \>\> The wiredump from soap4r request looks like this (after my  
> > \>\> clean-up/reformatting):  
> > \>\>  
> > \>\> POST /accountservice/account.asmx/GetOxSessionWithSource HTTP/1.1  
> > \>\> Content-Type: text/xml; charset=utf-8  
> > \>\> Soapaction: \"[http://oxbranch.optionsxpress.com/GetOxSessionWithSource\&lt;http://oxbranch.optionsxpress.com/GetOxSessionWithSource\&gt](http://oxbranch.optionsxpress.com/GetOxSessionWithSource%5C&lt;http://oxbranch.optionsxpress.com/GetOxSessionWithSource%5C&gt);  
> > "  
> > \>\> User-Agent: SOAP4R/1.5.5  
> > \>  
> > \> Version 1.5.5 is broken. Please install version 1.5.8 and try again.  
> > \>  
> > \> -- Mark.  
> > \>  
> > \>  
> > \>
> > 
> > --  
> > View this message in context:  
> > [http://www.nabble.com/wsdl2ruby-request-invalid-while-soapui's-is-correct-tp19717554p19726137.html](http://www.nabble.com/wsdl2ruby-request-invalid-while-soapui%27s-is-correct-tp19717554p19726137.html)  
> > Sent from the ruby-talk mailing list archive at Nabble.com.
