tags:

views:

407

answers:

1

Hi,

Im totally new to SOAP HTTP Requests. Can someone give me a broad rundown on things that might slow it down. Im working on a .NET application that uses SOAP, WSDL. The request is taking around 50 seconds, everytime. Im probably making no sense, so please excuse my ignorance. Could there be something I could do at my end, to allow the request to run without causing the page not to load. AJAX maybe.

--M

Edit (09/08/2009):

OK, i've used SOAPUI and its coming up with two options WebServiceSoap12 and WebServiceSoap. The first one is goving me a speedy milliseconds response, and the second is giving me a "400 Bad Request. Why would I need that second one?

Below is the WSDL

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.example.com" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.example.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.example.com"&gt;
      <s:element name="EventGetList">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="regionId" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="EventGetListResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="EventGetListResult" type="tns:ArrayOfOpenEvent" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="ArrayOfOpenEvent">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="OpenEvent" nillable="true" type="tns:OpenEvent" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="OpenEvent">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Id" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="EventStart" type="s:dateTime" />
          <s:element minOccurs="1" maxOccurs="1" name="EventEnd" type="s:dateTime" />
          <s:element minOccurs="0" maxOccurs="1" name="RegionId" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="EventSubject" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="EventAdditionalDetails" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="EventDelivery" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Location" type="tns:EventLocation" />
          <s:element minOccurs="1" maxOccurs="1" name="OnlineRegistrations" type="s:boolean" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="EventLocation">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Address3" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Town" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Postcode" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="AddressOther" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:element name="EventRegisterClient">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="registration" type="tns:OpenEventRegistration" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="OpenEventRegistration">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="EventId" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="ForeName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Surname" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="TelephoneNumber" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="EmailAddress" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:element name="EventRegisterClientResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="EventRegisterClientResult" type="s:boolean" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="EventGetListSoapIn">
    <wsdl:part name="parameters" element="tns:EventGetList" />
  </wsdl:message>
  <wsdl:message name="EventGetListSoapOut">
    <wsdl:part name="parameters" element="tns:EventGetListResponse" />
  </wsdl:message>
  <wsdl:message name="EventRegisterClientSoapIn">
    <wsdl:part name="parameters" element="tns:EventRegisterClient" />
  </wsdl:message>
  <wsdl:message name="EventRegisterClientSoapOut">
    <wsdl:part name="parameters" element="tns:EventRegisterClientResponse" />
  </wsdl:message>
  <wsdl:portType name="WebServiceSBSpEventsSoap">
    <wsdl:operation name="EventGetList">
      <wsdl:input message="tns:EventGetListSoapIn" />
      <wsdl:output message="tns:EventGetListSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="EventRegisterClient">
      <wsdl:input message="tns:EventRegisterClientSoapIn" />
      <wsdl:output message="tns:EventRegisterClientSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="WebServiceSBSpEventsSoap" type="tns:WebServiceSBSpEventsSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="EventGetList">
      <soap:operation soapAction="http://www.example.com/EventGetList" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="EventRegisterClient">
      <soap:operation soapAction="http://www.example.com/EventRegisterClient" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="WebServiceSBSpEventsSoap12" type="tns:WebServiceSBSpEventsSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="EventGetList">
      <soap12:operation soapAction="http://www.example.com/EventGetList" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="EventRegisterClient">
      <soap12:operation soapAction="http://www.example.com/EventRegisterClient" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="WebServiceSBSpEvents">
    <wsdl:port name="WebServiceSBSpEventsSoap" binding="tns:WebServiceSBSpEventsSoap">
      <soap:address location="http://www.example.com/webserviceexternal/WebServiceSBSpEvents.asmx" />
    </wsdl:port>
    <wsdl:port name="WebServiceSBSpEventsSoap12" binding="tns:WebServiceSBSpEventsSoap12">
      <soap12:address location="http://www.example.com/webserviceexternal/WebServiceSBSpEvents.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
+1  A: 

You should first try to pinpoint the cause of the delay, as there could be many reasons for it. Your main interest would be if the delay happens on the side of the server or on the side of (your) client.

If the delay is on the server side of things (might be a complicated operation to create a result, might be slow server, etc.), then you can look for workarounds to deal with that in your client, e.g.:

  • creating the page first and pulling the data from the service afterward via ajax, as you suggested
  • pulling the data from the service upfront in regular intervals and storing it in a local cache from which you construct your pages
  • etc...

If the delay is happening on the client side, you should try to find the root cause (e.g. network configuration, timeouts with reverse lookups, etc.) and fix it ;)


Edit: Given the posted wsdl, the web service offers itself in two variations, one for 'default' SOAP and one for SOAP 1.2. The 400 response indicates that the client is issuing the request in a non standard conform way, but it might also be that the service end is not properly set up for the protocol version it says to offer in the wsdl.

As for why you'd need one or the other, the answer is simple: Both offer the exact same methods, so you only need one. It could be that the delay is caused by your client first trying to use the defunct version a couple of times and only switching to the other after a while - but this is just guesswork. If SOAPUI works ok with the 1.2 version, I'd just try to tell the client to use that and see if that speeds things up.

Henrik Opel
found a link that may be dead, would that be causing it. <soap address="http://www.example.com/service.asmx" xmlns:q1="deadlinkhere" binding="q1:Service" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
madphp
Highly unlikely - Namespace URIs are not required to really point to any real content, as they are only used to uniquely identify the namespace, not to describe it or anything. Still many people put a readable document at the URI address that describes the namespace, but no XML parser/tool should really want to look that up, especially not 'wating' time in doing so.
Henrik Opel