You are not logged in.

#1 2007-05-02 09:35:26

sunilguptasg
Member
2 posts

How do I make a simple SOAP request?

Tags: [perl, webservice]

Hi,

I need to make a SOAP request like this:

POST / HTTP/1.0
SOAPAction: ""
Content-Type: text/xml
User-Agent: Borland SOAP 1.2
Content-Length: 475
Pragma: no-cache
Via: 1.0 proxynet.tallysolutions.com:8000 (squid/2.5.STABLE3)
X-Forwarded-For: 192.168.1.148
Host: 192.168.1.148:4051
Cache-Control: max-age=259200
Connection: keep-alive

<ENVELOPE>
<HEADER>
<TALLYREQUEST>Export Data</TALLYREQUEST>
</HEADER>
<BODY>
<EXPORTDATA>
<REQUESTDESC>
<REPORTNAME>SVClient Report</REPORTNAME>
<STATICVARIABLES>
<SVCURRENTCOMPANY>OFS Common Company</SVCURRENTCOMPANY>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<SVCLIENTNAME>Client A</SVCLIENTNAME>
</STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
</TALLYMESSAGE>
</REQUESTDATA>
</EXPORTDATA>
</BODY>
</ENVELOPE>

No matter what I try, I get this from the tWebServiceInput component:
POST / HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Accept: text/xml
Accept: multipart/*
Host: localhost:4051
User-Agent: SOAP::Lite/Perl/0.55
Content-Length: 574
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://localhost:4050#hh"

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:hh xmlns:namesp1="http://localhost:4050"><TALLYREQUEST xsi:type="xsd:string">BalanceSheet</TALLYREQUEST><TALLYMESSAGE xsi:type="xsd:string">Sunil</TALLYMESSAGE></namesp1:hh></SOAP-ENV:Body></SOAP-ENV:Envelope>

Please help,

Thanks
Sunil Gupta

Last edited by sunilguptasg (2007-05-07 10:15:00)

Offline

#2 2007-05-11 14:10:23

plegall
Member
1586 posts

Re: How do I make a simple SOAP request?

Reading your User-agent, I assume you use Perl as generated code. I must admit I have no trivial answer for you and my first post will be a question: how did you manage to produce:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope [...]>
  <SOAP-ENV:Body>
    <namesp1:hh xmlns:namesp1="http://localhost:4050">
      <TALLYREQUEST xsi:type="xsd:string">BalanceSheet</TALLYREQUEST>
      <TALLYMESSAGE xsi:type="xsd:string">Sunil</TALLYMESSAGE>
    </namesp1:hh>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I mean, how did you manage to give a name to your parameter while the GUI doesn't give you this possibility?

Offline

#3 2007-05-14 05:35:22

sunilguptasg
Member
2 posts

Re: How do I make a simple SOAP request?

Hi,

We are struggling to get our job done... but believe we can due to the architecture. It's great.

To address your query, I just wrote this in the Parameters block as values:

SOAP::Data->name('abc')->value(123); this creates:
<abc xsi:type="xsd:int">123</abc>

Regards
Sunil Gupta

Offline

Board footer