Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6006123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:29:41+00:00 2026-05-23T01:29:41+00:00

I create a Python webservice on Linux machine (ubuntu): import soaplib import os from

  • 0

I create a Python webservice on Linux machine (ubuntu):

import soaplib
import os

from soaplib.core.service import rpc, DefinitionBase, soap
from soaplib.core.model.primitive import String, Integer
from soaplib.core.server import wsgi
from soaplib.core.model.clazz import Array

def runcmd(cmd):
    fout = os.popen(cmd)
    out = fout.read()
    return out

class LinuxServices(DefinitionBase):
@soap(String, String,_returns=Array(String))
def df(self,server, user):
    L = []
    cmd = 'df -hP | grep "/"'
    output = runcmd(cmd).split('\n')
    for n in xrange(len(output)-1):
        out = output[n].split()
        L.append('%s;%s' % (out[5], out[4]))
    return L

if __name__=='__main__':
try:
    from wsgiref.simple_server import make_server
    soap_application = soaplib.core.Application([LinuxServices], 'tns')
    wsgi_application = wsgi.Application(soap_application)
    server = make_server('0.0.0.0', 7789, wsgi_application)
    server.serve_forever()
except ImportError:
    print "Error: example server code requires Python >= 2.5"

I created it based on this example: soaplib helloworld

Then (on Windows 7) I created a Silverlight project, where I use this ws to get disk status on my linux server:

Service in Silverlight project:

public class LinuxService
{
    [OperationContract]
    public List<dfItem> df()
    {
        List<dfItem> dfItems = new List<dfItem>();

        WebReference.Application app = new WebReference.Application();

        var result = app.df(new WebReference.df()/*...*/);

        foreach (var item in result.dfResult)
        {
            string[] info = item.Split(';');

            dfItem dfItem = new dfItem()
            {
                MountPoint = info[0].ToString(),
                Usage = info[1].ToString()
            };
            dfItems.Add(dfItem);
        }
        return dfItems;
    }
    //...
}

Calling service on page:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    LinuxServiceClient client = new LinuxServiceClient();

    client.dfCompleted += new EventHandler<dfCompletedEventArgs>(client_dfCompleted);

    client.dfAsync();
}

void client_dfCompleted(object sender, dfCompletedEventArgs e)
{
    DG.ItemsSource = e.Result;
    DG.Visibility = System.Windows.Visibility.Visible;
}

My problem is that when I navigate to this page, it takes 4-8 seconds to get data from ws (ws in LAN).

I really doubt that line bandwidth can create this wait time…

My question:
Do you have any suggestions what can I do to speed up this?

System Info:

  • UbuntuServer 11.04

  • Python: Python 2.7

  • Soaplib: soaplib 2.0.0-beta2


  • Windows: Windows 7 sp1

  • Silverlight: Silverlight 4

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:29:42+00:00Added an answer on May 23, 2026 at 1:29 am

    I’d recommend using wireshark http://www.wireshark.org/ to ‘listen’ in on the conversation that is occurring over the network by recording (‘capturing’) copies of the network traffic that the device can see.

    When you start a capture, the amount of data can seem overwhelming, but if you can spot any fragments that look like your SOAP message (should be easy to spot), then you can swiftly filter to just that conversation by right-clicking and selecting ‘Follow TCP Stream’.

    You can then see the entire conversation between the SOAP service you’ve written and the silverlight client in a pop-up window.

    If that all looks fine, then close the popup window. As an added bonus, wireshark will have filtered out the list of fragments to just those in the conversation with timestamps as to when they happened. Use this to find out whether it’s client or server that is being slow to respond.

    If there appears to be no real delay, then I would suggest that there is a considerable lag between asking Silverlight to do a SOAP call and it actually making the network call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i try to setup a ubuntu server with web service that create by django/python
i want to create a webservice (SOAP & REST) in python which cab be
I'm looking to create favicon.ico files programatically from Python, but PIL only has support
I have a problem with Python and SOAP. I need to create a web
I am calling a WSDL web service from Python using SOAPpy . The call
I am trying to talk to a SOAP web service using SUDS and Python.
I'm trying to create a python server that will serve calls from outer source
I have the following code to return multiple values from pl/python: CREATE TYPE named_value
I am looking to create a web service in Python, but none of the
I have written a code in Python to create a transition probability matrix from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.