2

I'm trying to build a SOAP server for an existing SOAP client. I have a simple function working fine that just returns a string. Now I'm building a more complex function and I get no SOAP response sent, when I watch traffic with Wireshark.

Here is my function:

def getMetadata(id, index, count):
print "id =", id
response = {'index': 0,
            'count': 1,
            'total': 1}
return response

And my function registration:

dispatcher.register_function('getMetadata', getMetadata,
                         returns={'getMetadataResult': {'index': int, 'count': int, 'total': int}},
                         args={'id': str, 'index': int, 'count': int})

I think I have a problem matching up my "returns" in register_function with the response I've built in getMetadata.

For reference, here's the expected SOAP response I'm trying to build:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getMetadataResponse xmlns="<removed>">
      <getMetadataResult>
        <index>0</index>
        <count>3</count>
        <total>3</total>
      </getMetadataResult>
    </getMetadataResponse>
  </soap:Body>
</soap:Envelope>
Malcolm Crum
  • 4,345
  • 4
  • 30
  • 49
  • A small followup - there must be an error message somewhere as the function fails to parse, or something. I've tried setLevel(logging.DEBUG) on a few things but can't seem to get these errors to appear. Any advice on making this thing a bit more verbose? – Malcolm Crum Mar 27 '13 at 17:32

0 Answers0