我对SOAP HTTP请求完全陌生。有人可以给我一些关于可能减慢它的事情的广泛纲要。我正在使用SOAP,WSDL的.NET应用程序。每次请求大约需要50秒。我可能没有任何意义,所以请原谅我的无知。我可以在我的最后做一些事情,允许请求运行而不会导致页面无法加载。 AJAX也许。
- 中号
编辑(09/08/2009):
好的,我已经使用了SOAPUI,它提出了两个选项WebServiceSoap12和WebServiceSoap。第一个是给我一个快速的毫秒响应,第二个是给我一个“400 Bad Request。为什么我需要第二个?
以下是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/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.example.com">
<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>
答案 0 :(得分:1)
您应首先尝试查明延迟的原因,因为可能有很多原因。您的主要兴趣是如果延迟发生在服务器一侧或(您)客户端。
如果延迟在服务器端(可能是创建结果的复杂操作,可能是服务器速度慢等),那么您可以寻找解决方法来处理客户端中的问题,例如:< / p>
如果在客户端发生延迟,您应该尝试查找根本原因(例如网络配置,反向查找超时等)并修复它;)
编辑:鉴于发布的wsdl,Web服务提供了两种变体,一种用于“默认”SOAP,另一种用于SOAP 1.2。 400响应表明客户端以非标准符合方式发出请求,但也可能是服务端未正确设置其在wsdl中提供的协议版本。
至于为什么你需要其中一个,答案很简单:两者都提供完全相同的方法,所以你只需要一个。 可能延迟是由于您的客户首次尝试使用已解散的版本几次并且仅在一段时间后才切换到另一个版本 - 但这只是猜测。如果SOAPUI与1.2版本一起工作正常,我只是试图告诉客户端使用它,看看是否加快了速度。