Answered

SOAP Webservice namespace with # before action

  • 23 September 2022
  • 6 replies
  • 126 views

Hi,

I’m implementing my own SOAP Webservice based on the provided WSDL.

 

At the provided WSDL the trailing slash is replaced by a # before the action.

Ex.: http://www.sonos.com/Services/1.1#search

At my implementation the action URL si the following

Ex.: http://www.sonos.com/Services/1.1/search

 

So the calls to my SOAP Webservice fail with the following error:

System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://www.sonos.com/Services/1.1#search.

 

I’ve already added my custom music service to the device at the APP but I get no calls to the API

 

My Web Service is implemented with C# ASMX

icon

Best answer by NUno Oliveira 28 September 2022, 14:16

View original

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

6 replies

Why reinvent the wheel?

 

https://github.com/search?l=C%23&q=sonos&type=Repositories

Yes, you are so right!

Somehow I've missed this repositories.

 

I’ll take a look to them
Much appreciated for your input! 

Just to give un update.

I’ve solved this issue by creating a proxy at my REST API to get the requests

Userlevel 7
Badge +23

If you are going to post StackOverflow-type questions here, please include the full request/response payload.

If you are going to post StackOverflow-type questions here, please include the full request/response payload.

Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
   <soapenv:Header>       
   </soapenv:Header>
   <soapenv:Body>
      <ns:getLastUpdate/>
   </soapenv:Body>
</soapenv:Envelope>

 

Reply with Skip SOAP Action = false (do not reach API endpoint)
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?RDpcUHJvamVjdHNcV2F5bWVkaWEyMDIwXFdheWJveFdTXFNPTk9TLmFzbXg=?=
X-Powered-By: ASP.NET
Date: Tue, 27 Sep 2022 00:38:43 GMT
Content-Length: 817

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://www.sonos.com/Services/1.1#getLastUpdate.
   at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

 

Reply with Skip SOAP Action = true (reaching API endpoint and returning data)

HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Vary: Accept-Encoding
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?RDpcUHJvamVjdHNcV2F5bWVkaWEyMDIwXFdheWJveFdTXFNPTk9TLmFzbXg=?=
X-Powered-By: ASP.NET
Date: Tue, 27 Sep 2022 00:40:57 GMT

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><getLastUpdateResponse xmlns="http://www.sonos.com/Services/1.1"><getLastUpdateResult><autoRefreshEnabled>true</autoRefreshEnabled><catalog>123</catalog><favorites>1</favorites><pollInterval>30</pollInterval></getLastUpdateResult></getLastUpdateResponse></soap:Body></soap:Envelope>

 

Basicaly, what I’m trying to do is create an app to select my custom playlist (with my own mp3 files) to my SONOS device,