none
Consuming WCF Service issue RRS feed

  • General discussion

  • Hi All,

    Facing the below error.

    <<

    System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (405) Method Not Allowed. ---> System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.
       at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       --- End of inner exception stack trace ---

    Server stack trace:
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxi

    >>

    Please help me.


    Thanks UK

    Monday, August 27, 2012 6:46 AM

All replies

  • Hi,

    Please help me.

    >>

    System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
       at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       --- End of inner exception stack trace ---

    Server stack trace:
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.Hand

    >>


    Thanks UK

    Monday, August 27, 2012 7:10 AM
  • How you are trying to consume this service. BizTalk or .net application.

    As per error Server is doing User authentication for which its throwing error NTLM. Use custom http binding and set the authenication property as per requirement. I would suggest better first understand what is wcf service security requirment and then do corresponding changes in bindings

    Something like this

    Monday, August 27, 2012 7:17 AM
  • Hi, I got the below error if i go for it. << System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.CreateChannelFactory[TChannel](IBaseMessage bizTalkMessage) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.InitializeValues(IBaseMessage message) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2..ctor(IBaseMessage message, WcfTransmitter`2 transmitter) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfTransmitter`2.GetClientFromCache(String spid, IBaseMessage message) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfAsyncBatch`2.BatchWorker(List`1 messages) >> Please suggest

    Thanks UK

    Monday, August 27, 2012 7:45 AM
  • As i told you previously, before you start troubleshooting this issue please verfiy what is required from service side. If you don't have such information, it will be just guess work from client machine
    Monday, August 27, 2012 9:22 AM
  • For Negotiate NTLM, Unauthorised error, we need to do the following.

    In the WCF BasicHttp adapter configuration, in the security tab, select security mode as TransportCredentialOnly and the TransportClientCredentialType as ntlm.

    In case of Value can not be null, need to dig the SP whether it is asking some other type of data.


    Thanks UK

    Friday, August 31, 2012 1:19 PM
  • TypedProcedure/dbo/spM2PQTQMine

    <BtsActionMapping>

    <OperationName="GetData" Action="htp://schemas........."/>

    </BtsActionMapping>

    SendPort Retrycount=0


    Thanks UK

    Monday, September 3, 2012 1:55 PM