gSOAP XML server / POST command

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications gSOAP XML server / POST command
# 1  
Old 06-14-2011
gSOAP XML server / POST command

hi,

the idea is that I use gSOAP library for creating XML server. that is... is it possible to even use gSOAP functionality at server side and no gSOAP at client. client would be like curl POST command(curl -d data=somexml -X POST url=http_127.0.0.1) with short data(or XML data).

i spend already a lot of time traying to figure it out. i get a call at server side, but it seems that every data gets enveloped with soap headers.
- i registered post_plugin
- i did not create header file because i don't need soap functions

if anyone knows if this is possible i would appreciate answering. thanks

ziga
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing XML using command line

Hi Experts, How do I parse a XML with below contents <saw:user name="mbussey@xyz.com" /> <saw:user name="kimmy.chan@pqr.com" /> <saw:user name="chudgins@gmail.com" /> and retrieve below output ? mbussey@xyz.com kimmy.chan@pqr.com chudgins@gmail.com ... (17 Replies)
Discussion started by: pauldx
17 Replies

2. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

3. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

4. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

5. Shell Programming and Scripting

I need script to get xml access export from source server

Hi, I need a shell script to create to get XML access export from the source server. Thanks in Advance (3 Replies)
Discussion started by: bcb
3 Replies

6. Shell Programming and Scripting

Parsing posted XML data from a remote server?

Hi Is it possible to parse a posted xml data from a remote server in unix shell script. if so how to do that? and i need to give this script path in the push url (in remote server) . how to do this? I have tried this in asp but could not succeed....so am trying in shell scripting...the thread... (1 Reply)
Discussion started by: aemunathan
1 Replies

7. Shell Programming and Scripting

How to send XML data using HTTP Post Request

How to hit HTTP Post Request along with sending XML data to a Remote server through command line utility like wget (or anything else). (0 Replies)
Discussion started by: sandeep reddy
0 Replies

8. SCO

XML Import & HTTP Post

this may be very basic to some but all new to me I have an application running on SCO Unix server which issues an HTTP Post request to a server with the results being returned in I.E browser window in XML format I need to import these results into my customers application and dont know how to... (1 Reply)
Discussion started by: ccarcher
1 Replies
Login or Register to Ask a Question
XML::Atom::Server(3pm)					User Contributed Perl Documentation				    XML::Atom::Server(3pm)

NAME
XML::Atom::Server - A server for the Atom API SYNOPSIS
package My::Server; use base qw( XML::Atom::Server ); sub handle_request { my $server = shift; $server->authenticate or return; my $method = $server->request_method; if ($method eq 'POST') { return $server->new_post; } ... } my %Passwords; sub password_for_user { my $server = shift; my($username) = @_; $Passwords{$username}; } sub new_post { my $server = shift; my $entry = $server->atom_body or return; ## $entry is an XML::Atom::Entry object. ## ... Save the new entry ... } package main; my $server = My::Server->new; $server->run; DESCRIPTION
XML::Atom::Server provides a base class for Atom API servers. It handles all core server processing, both the SOAP and REST formats of the protocol, and WSSE authentication. It can also run as either a mod_perl handler or as part of a CGI program. It does not provide functions specific to any particular implementation, such as posting an entry, retrieving a list of entries, deleting an entry, etc. Implementations should subclass XML::Atom::Server, overriding the handle_request method, and handle all functions such as this themselves. SUBCLASSING
Request Handling Subclasses of XML::Atom::Server must override the handle_request method to perform all request processing. The implementation must set all response headers, including the response code and any relevant HTTP headers, and should return a scalar representing the response body to be sent back to the client. For example: sub handle_request { my $server = shift; my $method = $server->request_method; if ($method eq 'POST') { return $server->new_post; } ## ... handle GET, PUT, etc } sub new_post { my $server = shift; my $entry = $server->atom_body or return; my $id = save_this_entry($entry); ## Implementation-specific $server->response_header(Location => $server->uri . '/entry_id=' . $id); $server->response_code(201); $server->response_content_type('application/x.atom+xml'); return serialize_entry($entry); ## Implementation-specific } Authentication Servers that require authentication for posting or retrieving entries or feeds should override the password_for_user method. Given a username (from the WSSE header), password_for_user should return that user's password in plaintext. This will then be combined with the nonce and the creation time to generate the digest, which will be compared with the digest sent in the WSSE header. If the supplied username doesn't exist in your user database or alike, just return "undef". For example: my %Passwords = ( foo => 'bar' ); ## The password for "foo" is "bar". sub password_for_user { my $server = shift; my($username) = @_; $Passwords{$username}; } METHODS
XML::Atom::Server provides a variety of methods to be used by subclasses for retrieving headers, content, and other request information, and for setting the same on the response. Client Request Parameters o $server->uri Returns the URI of the Atom server implementation. o $server->request_method Returns the name of the request method sent to the server from the client (for example, "GET", "POST", etc). Note that if the client sent the request in a SOAP envelope, the method is obtained from the SOAPAction HTTP header. o $server->request_header($header) Retrieves the value of the HTTP request header $header. o $server->request_content Returns a scalar containing the contents of a POST or PUT request from the client. o $server->request_param($param) XML::Atom::Server automatically parses the PATH_INFO sent in the request and breaks it up into key-value pairs. This can be used to pass parameters. For example, in the URI http://localhost/atom-server/entry_id=1 the entry_id parameter would be set to 1. request_param returns the value of the value of the parameter $param. Setting up the Response o $server->response_header($header, $value) Sets the value of the HTTP response header $header to $value. o $server->response_code([ $code ]) Returns the current response code to be sent back to the client, and if $code is given, sets the response code. o $server->response_content_type([ $type ]) Returns the current Content-Type header to be sent back to the client, and $type is given, sets the value for that header. Processing the Request o $server->authenticate Attempts to authenticate the request based on the authentication information present in the request (currently just WSSE). This will call the password_for_user method in the subclass to obtain the cleartext password for the username given in the request. o $server->atom_body Returns an XML::Atom::Entry object containing the entry sent in the request. USAGE
Once you have defined your server subclass, you can set it up either as a CGI program or as a mod_perl handler. A simple CGI program would look something like this: #!/usr/bin/perl -w use strict; use My::Server; my $server = My::Server->new; $server->run; A simple mod_perl handler configuration would look something like this: PerlModule My::Server <Location /atom-server> SetHandler perl-script PerlHandler My::Server </Location> ERROR HANDLING
If you wish to return an error from handle_request, you can use the built-in error method: sub handle_request { my $server = shift; ... return $server->error(500, "Something went wrong"); } This will be returned to the client with a response code of 500 and an error string of "Something went wrong". Errors are automatically serialized into SOAP faults if the incoming request is enclosed in a SOAP envelope. AUTHOR &; COPYRIGHT Please see the XML::Atom manpage for author, copyright, and license information. perl v5.12.4 2011-09-27 XML::Atom::Server(3pm)