[Soap-Python] parsing SOAP request

Chris Austin chris at sydneysys.com
Thu Jan 27 16:24:49 CET 2011


Hi Sami,

Your colors aren't showing up in my email client so I'll do my best to punt and guess at what you are trying to do.

If you are using soaplib to serve this WS I'd probably do something like the following.


class YourDataType(ClassModel):
  unique_id = Integer
  application_id = Integer
  transaction_id = Integer
  placeholder_1 = String
  placeholder_2 = String
  message = String

class YourService(DefinitionBase):

  @soap(YourDataType, _returns=YourDataType)
  def processs_samis_request(self, your_data_type):
    ...
    # doing domiain logic.....
    ...
    return your_data_type_instance 


Where the instance 'your_data_type_instance' is a modified instance of 'YourDataType' that you've updated per your needs.

Hope this helps.


----- Original Message -----
From: "sami nathan" <itssami.gb4u at gmail.com>
To: soap at python.org
Sent: Thursday, January 27, 2011 12:51:43 AM
Subject: [Soap-Python] parsing SOAP request


Hi 
i am working in django web service i am getting SOAP(POST) request from client now i am trying to parse the request xml and sending the response my soap request is 

<QueryDict: {u'<?xml version': [u'\'1.0\' encoding=\'UTF-8\'?><soapenv: 
Envelope 
xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ "><soapenv:Body><ns1:rec 
eiveShortMessageRequest xmlns:ns1=" http://flypp.infy.com/sms/v2010r1_0 "><uniqueI 
D>1234534366</uniqueID><applicationID>1</applicationID><transactionID>t1</transa 
ctionID><placeholder_1>p1</placeholder_1><placeholder_2>p2</placeholder_2><messa 
ge>DICT test</message></ns1:receiveShortMessageRequest></soapenv:Body></soapenv: 
Envelope>']}> 
response 
now i want send response as change is denoted in colors 
'<?xml version': [u'\'1.0\' encoding=\'UTF-8\'?><soapenv:Envelope 
xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ "><soapenv:Body><ns1:rec 
eiveShortMessageRequest xmlns:ns1=" http://flypp.infy.com/sms/v2010r1_0 "><uniqueI 
D>1234534366</uniqueID><applicationID>1</applicationID><transactionID>t1</transa 
ctionID><placeholder_1>p1</placeholder_1><placeholder_2>p2</placeholder_2><messa 
ge> TEXT HERE </message></ns1:receiveShortMessageRequest></soapenv:Body></soapenv: 
Envelope>']}> 
_______________________________________________
Soap mailing list
Soap at python.org
http://mail.python.org/mailman/listinfo/soap


More information about the Soap mailing list