Forum Discussion

Raja_Marla's avatar
Raja_Marla
New Contributor
15 years ago

soapUI and WCF Service

I just tried an Visual Studio 2008 out-of-the-box sample web service (.NET 3.5 SP1).      The web service works fine when executed with MSFT supplied tool  WcFTestClient.        However, I get a "Bad Request" response, when I use SOAP UI.    I changed the binding to "basicHttpBinding" based on some earlier posts, that I came across - but I continue to see the "Bad Request" response.

The webservice is as simple as I can make it.....accepts a string as input, and prints out a string as output.

Does SOAPUI work with .net 3.5 wcf web service?

Here is the WSDL....


  <?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions name="Service1" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
- <wsdl:types>
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
  <xsd:import schemaLocation="http://ism-epy-geneva.ssainternal.net/ProfileUpdate/Service1.svc?xsd=xsd0" namespace="http://tempuri.org/" />
  <xsd:import schemaLocation="http://ism-epy-geneva.ssainternal.net/ProfileUpdate/Service1.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
  <xsd:import schemaLocation="http://ism-epy-geneva.ssainternal.net/ProfileUpdate/Service1.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/ProfileUpdate" />
  </xsd:schema>
  </wsdl:types>
- <wsdl:message name="IService1_GetData_InputMessage">
  <wsdl:part name="parameters" element="tns:GetData" />
  </wsdl:message>
- <wsdl:message name="IService1_GetData_OutputMessage">
  <wsdl:part name="parameters" element="tns:GetDataResponse" />
  </wsdl:message>
- <wsdl:message name="IService1_GetDataUsingDataContract_InputMessage">
  <wsdl:part name="parameters" element="tns:GetDataUsingDataContract" />
  </wsdl:message>
- <wsdl:message name="IService1_GetDataUsingDataContract_OutputMessage">
  <wsdl:part name="parameters" element="tns:GetDataUsingDataContractResponse" />
  </wsdl:message>
- <wsdl:portType name="IService1">
- <wsdl:operation name="GetData">
  <wsdl:input wsaw:Action="http://tempuri.org/IService1/GetData" message="tns:IService1_GetData_InputMessage" />
  <wsdl:output wsaw:Action="http://tempuri.org/IService1/GetDataResponse" message="tns:IService1_GetData_OutputMessage" />
  </wsdl:operation>
- <wsdl:operation name="GetDataUsingDataContract">
  <wsdl:input wsaw:Action="http://tempuri.org/IService1/GetDataUsingDataContract" message="tns:IService1_GetDataUsingDataContract_InputMessage" />
  <wsdl:output wsaw:Action="http://tempuri.org/IService1/GetDataUsingDataContractResponse" message="tns:IService1_GetDataUsingDataContract_OutputMessage" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="BasicHttpBinding_IService1" type="tns:IService1">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="GetData">
  <soap:operation soapAction="http://tempuri.org/IService1/GetData" style="document" />
- <wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
- <wsdl:operation name="GetDataUsingDataContract">
  <soap:operation soapAction="http://tempuri.org/IService1/GetDataUsingDataContract" style="document" />
- <wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="Service1">
- <wsdl:port name="BasicHttpBinding_IService1" binding="tns:BasicHttpBinding_IService1">
  <soap:address location="http://ism-epy-geneva.ssainternal.net/ProfileUpdate/Service1.svc" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    please check that the http version set in the http preferences dialog is set to 1.1 or 1.0 (not 0.9).. does that help?

    regards!

    /Ole
    eviware.com
  • Raja_Marla's avatar
    Raja_Marla
    New Contributor
    You did (amazingly) spot an error in my configuration....which I stumbled on to it myself, a while after posting this.    I did change the http version.....but I still am getting an error.

    I then tried changing soap version of the service: SOAP 1.2 and SOAP 1.1.....but neither seem to help.    Soap 1.2 returns the following while SOAP 1.1 returns the "Bad Request" error.

    HTTP/1.1 415 Cannot process the message because the content type 'application/soap+xml;charset=UTF-8;action="http://tempuri.org/IService1/GetDataUsingDataContract"' was not the expected type 'text/xml; charset=utf-8'.
    Connection: close
    Date: Sun, 10 May 2009 03:18:13 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Length: 0
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    You will need to use SOAP 1.1 and you should upgrade to the latest nightly build (available here). In the request, make sure WS-A addressing is enabled. This is done by opening the Request in SoapUI, selecting the WS-A tab on the bottom, and making sure that the Enable WS-A addressing checkbox is checked.
    Once checked SoapUI should fill in the rest, but if it fails you can manually enter the wsa:Action and check Generate MessageID.
    Good luck!

    Regards,
    Dain
    eviware support