Problem in calling a SOAP RPC function from lasso code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in calling a SOAP RPC function from lasso code

Gourav Singh
Hi,

I am trying to call a SOAP RPC function from my lasso code.
I am sending the parameter as post method in XML format and expecting to get the result in XML format.

Here is my code:
[Var: 'path' = 'http://127.0.0.1/soap/servlet/rpcrouter']

[Variable: 'Result' = (Include_URL: $path, -PostParams=$SOAP_Envelope,-SendMIMEHeaders=(Array: 'content-type'='text/xml'))]

Error:

"java.lang.IllegalArgumentException: No Serializer found to serialize a 'org.w3c.dom.Element' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'. (SOAP-ENV:Server) "

When I am using following code from terminal, it is returning the result.

curl -d @post.txt --header "Content-type: text/xml" http://127.0.0.1/soap/servlet/rpcrouter

Where post.txt contains the XML format input.

Can any one help me on this!!

Awaiting for the solution.

Thanks in Advance..

Gourav Singh
Mindfire Solutions Pvt. Ltd.




#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Problem in calling a SOAP RPC function from lasso code

Brad Lindsay
On 4/25/13 8:48 AM, [hidden email] wrote:

> I am trying to call a SOAP RPC function from my lasso code.
> I am sending the parameter as post method in XML format and expecting to get the result in XML format.
>
> Here is my code:
> [Var: 'path' = 'http://127.0.0.1/soap/servlet/rpcrouter']
>
> [Variable: 'Result' = (Include_URL: $path, -PostParams=$SOAP_Envelope,-SendMIMEHeaders=(Array: 'content-type'='text/xml'))]
>
> Error:
>
> "java.lang.IllegalArgumentException: No Serializer found to serialize a 'org.w3c.dom.Element' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'. (SOAP-ENV:Server)"
>
> When I am using following code from terminal, it is returning the result.
>
> curl -d @post.txt --header "Content-type: text/xml" http://127.0.0.1/soap/servlet/rpcrouter
>
> Where post.txt contains the XML format input.


1. Get rid of colon syntax and start only using parenthesis syntax. You
will eventually be glad you did.


2. The error you are getting, is that what is being stored in the
"Result" variable? So it's an error from the SOAP server?

3. Are you sure that $SOAP_Envelope contains the *exact* same contents
as the post.txt file?

4. I noticed that you didn't capitalize "Content-type" in the Lasso
[include_url] but you did in the curl command-line request. What happens
if you capitalize it in the [include_url]?


Brad


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Problem in calling a SOAP RPC function from lasso code

Gourav Singh
In reply to this post by Gourav Singh
Thanks Brad for the reply.

I have checked the content is same as "post.txt".

Also capitalized "Content-type".

But still getting same error. :(



#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Problem in calling a SOAP RPC function from lasso code

Tim Taplin
In reply to this post by Brad Lindsay
One method I have used to help in testing these scenarios is to setup a page locally where you can output the raw request, headers and body of your requests so that you can see what the differences may be.

so, if you point your path at 127.0.0.1/lassotest/request.lasso

and have lassotest/request.lasso output the request parameters, request headers, and request body, you will likely find some difference or at least some hints to help keep you moving forward in your quest to solve the issue.

That being said, it seems as if there's some sort of encoding mismatch in the transmission of data. I'd be looking at the mime headers to make sure its coming out as you expect.

Remember that you can point the curl test at the same test address and compare what is being passed to the service by each type of request.

Tim Taplin

On Apr 25, 2013, at 5:40 PM, Brad Lindsay <[hidden email]> wrote:

> On 4/25/13 8:48 AM, [hidden email] wrote:
>> I am trying to call a SOAP RPC function from my lasso code.
>> I am sending the parameter as post method in XML format and expecting to get the result in XML format.
>>
>> Here is my code:
>> [Var: 'path' = 'http://127.0.0.1/soap/servlet/rpcrouter']
>>
>> [Variable: 'Result' = (Include_URL: $path, -PostParams=$SOAP_Envelope,-SendMIMEHeaders=(Array: 'content-type'='text/xml'))]
>>
>> Error:
>>
>> "java.lang.IllegalArgumentException: No Serializer found to serialize a 'org.w3c.dom.Element' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'. (SOAP-ENV:Server)"
>>
>> When I am using following code from terminal, it is returning the result.
>>
>> curl -d @post.txt --header "Content-type: text/xml" http://127.0.0.1/soap/servlet/rpcrouter
>>
>> Where post.txt contains the XML format input.
>
>
> 1. Get rid of colon syntax and start only using parenthesis syntax. You will eventually be glad you did.
>
>
> 2. The error you are getting, is that what is being stored in the "Result" variable? So it's an error from the SOAP server?
>
> 3. Are you sure that $SOAP_Envelope contains the *exact* same contents as the post.txt file?
>
> 4. I noticed that you didn't capitalize "Content-type" in the Lasso [include_url] but you did in the curl command-line request. What happens if you capitalize it in the [include_url]?
>
>
> Brad
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>