Forum Discussion

changjz's avatar
changjz
New Contributor
16 years ago

Does SoapUI works for WSHttpBinding WCF now?

HI

I saw similar topic on this forum, but i can't find out the solution to solve the problem. Please help.

We are using SoapUI 3.0.1 Pro, and calling the WCF (WSHttpBinding) from our testing server.

Our SoapUI project works fine for BasicHttpBinding, but once we set it up to WSHttpBinding, it gives us the following error:
(I already enabled the WSA-Addressing in my SoapUI project.)

For Soap 1.1:
#status# HTTP/1.1 415 Cannot process the message because the content type 'text/xml;charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.

For Soap 1.2:
#status# HTTP/1.1 500 Internal Server Error

The message could not be processed. This is most likely because the action 'http://tempuri.org/IPricingService/GetPricingRequest' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

please help.

Thanks.
  • shelingzhang's avatar
    shelingzhang
    Occasional Contributor
    Do you guy figure out the problem?
    I have the same problem, but it is on hold. if you found the solution, please let people know to avoid they ask the same question again and again, even it is wsdl specific problem, you can still post snip of wsdl, or a fake wsdl which doesn't contain info you don't want us to know.

    Please help others also help yourself in some way.


    Thanks
  • changjz's avatar
    changjz
    New Contributor
    shelingzhang wrote:

    Do you guy figure out the problem?
    I have the same problem, but it is on hold. if you found the solution, please let people know to avoid they ask the same question again and again, even it is wsdl specific problem, you can still post snip of wsdl, or a fake wsdl which doesn't contain info you don't want us to know.

    Please help others also help yourself in some way.


    Thanks


    I haven't got any feedback so far, 
  • Edit: I did notice that the basicHttpBinding was mentioned above, but now, there is an example to follow it.  Otherwise, please disregard this response. 

    After having the same issue, I searched around and with a little trial and error I found what I would consider a work around perfect for a testing environment.  The work around solution is simple.  Change the binding from wsHttpBinding to basicHttpBinding.  Do this only for your testing environment.  Microsoft recommends the usage of wsHttpBinding and not the legacy basicHttpBinding.

    In your app.config or web.config specify a new binding: 


    <system.serviceModel>
      <bindings>
         <basicHttpBinding>
            <binding name="HTTPAccountServiceBinding" maxReceivedMessageSize="1000000"
                    closeTimeout="00:02:00" sendTimeout="00:02:00">
            </binding>
          </basicHttpBinding>
      </bindings>

      <services>
          <service name="TestService" behaviorConfiguration="TestServiceBehavior">
            <host>
              <baseAddresses>
                <add baseAddress = "http://localhost:6000/TestService/" />
              </baseAddresses>
            </host>
            <endpoint address="" binding="basicHttpBinding" bindingConfiguration="HTTPAccountServiceBinding" contract="MyCompany.Service.ITestService">
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
    </system.serviceModel>


    Anyways, thought I would share what got me into an appropriate testing situation.

    Regards,
    Chris Danielson