0
votes

I am trying to consume a rest-service which supports PUT operation method type. And I am trying this using BizTalk WCF-WebHttp static send port. But Always it returns error as

System.Net.WebException: The remote server returned an unexpected response: (405) MethodNotAllowed.

Not getting what am I doing wrong or did I miss anything.

I tried consuming the same rest service using Postman and it is working.

Also I tried with consuming the service using BizTalk dynamic ports and it works.

I have configured "HTTP Method and URL Mapping" as below:

<BtsHttpUrlMapping><Operation Method = "PUT" /></BtsHttpUrlMapping>
Security Mode : None
Content-Type: application/json

I want this to work with static BizTalk send port using WCF-Webhttp adapter.

2
HTTP Method and URL Mapping : "<BtsHttpUrlMapping><Operation Method = "PUT" /></BtsHttpUrlMapping>" - Code_ABC
are you sure your code is using put? - BugFinder
Tried monitoring the service call using fiddler, and notice that the Method passed to service call is "POST". So, now its sure that config for PUT at port level is not reflecting in the service call - Code_ABC
Now that you have identified the client configuration problem, have you solved the problem? If you do, please share your solution with us and mark it as an answer, so that helps them with a similar issue. in my opinion, there might be something wrong with the WCF-webhttp adapter configuration. - Abraham Qian

2 Answers

0
votes

In your "HTTP Method and URL Mapping" you either need to just have just

PUT

or

<BtsHttpUrlMapping><Operation Name="OpName" Method = "PUT" /></BtsHttpUrlMapping>

where OpName matches the Operation context property on the message.

0
votes

You have to mention the verb and content type in the Message tab as well, if it is not mentioned.

Message tab