11 Replies Latest reply: Jul 12, 2012 11:43 AM by tipi RSS

    SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.

    783894
      I'm attempting to use one of the Administrative Services WSDLs, FieldManagement, to query fields. You would think this would be pretty simple, but its not and documentation is non existant. Via C# I'm building a fairly basic query structure, similar to the structure I have used for 10-15 other web service apps without issue up until now. Unfortunately this one produces an error
      SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.

      There doesnt seem to be any access issues, as I can run the Oracle provided Migration tool against this environment without error, but the level of control you have with the Migration tool is crappy so I'm building my own. I've dumped the SOAP request and response out via a SoapExtension and included it below.

      Anyone have any ideas?
      Cheers,
      Mark

      -----SoapRequest at 21/09/2010 15:41:08
      <?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><FieldManagementRead_Input xmlns="urn:crmondemand/ws/odesabs/fieldmanagement/"><FieldSet xmlns="urn:/crmondemand/xml/fieldmanagement/query"><ObjectName>Contact</ObjectName><ListOfFields><Field /></ListOfFields></FieldSet></FieldManagementRead_Input></soap:Body></soap:Envelope>
      -----SoapResponse at 21/09/2010 15:41:09
      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Client</faultstring><detail><ErrorCode>SBL-ODU-01007</ErrorCode><ErrorMessage>The HTTP request did not contain a valid SOAPAction header. The value of the header was &quot;document/urn:crmondemand/ws/odesabs/FieldManagement/:FieldManagementRead&quot;</ErrorMessage></detail></soap:Fault></soap:Body></soap:Envelope>
        • 1. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
          583340
          You might want to check the URL you are using. I was able to reproduce the error message you mention by incorrectly using http://secure-auxomxXXX.crmondemand.com/Services/Integration for the Field Management Service.

          The correct URL for the field management service is https://secure-ausomxXXX.crmondemand.com/Services/cte/FieldManagementService

          For example:
          POST /Services/cte/FieldManagementService HTTP/1.1
          Content-Type: text/xml; charset=utf-8
          SOAPAction: "document/urn:crmondemand/ws/odesabs/FieldManagement/:FieldManagementReadAll"
          Host: ******
          Content-Length: ***
          Connection: Close

          <?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:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <soap:Header>
          <wsse:Security>
          <wsse:UsernameToken>
          <wsse:Username>*****</wsse:Username>
          <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">*****</wsse:Password>
          </wsse:UsernameToken>
          </wsse:Security>
          </soap:Header>
          <soap:Body>
          <FieldManagementReadAll_Input xmlns="urn:crmondemand/ws/odesabs/fieldmanagement/">
          </FieldManagementReadAll_Input>
          </soap:Body>
          </soap:Envelope>


          HTTP/1.1 200 OK
          Date: Tue, 21 Sep 2010 16:14:56 GMT
          Server: Oracle-Application-Server-10g
          SOAPAction: ""
          Vary: Accept-Encoding,User-Agent
          Connection: close
          Content-Type: text/xml; charset=utf-8

          <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="urn:crmondemand/ws/odesabs/fieldmanagement/" xmlns:ns1="urn:/crmondemand/xml/fieldmanagement/query" xmlns:ns2="urn:/crmondemand/xml/fieldmanagement/data">
          <env:Header>
          <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http:
          //schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1"/>
          </env:Header>
          <env:Body>
          <ns0:FieldManagementReadAll_Output>

          [a bunch of field management output...]

          </ns0:FieldManagementReadAll_Output>
          </env:Body>
          </env:Envelope>
          • 2. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
            783894
            Good call... I was just pulling the url, sessionid and all from the OnDemandWebService.Session. Ive changed this to manually extract the server details and sessionid and create the URL manually using /Services/cte/FieldManagementService. Unfortunately, while my original header error message has gone away I now get...
            <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><faultcode xmlns="">wsse:InvalidSecurity</faultcode><faultstring xmlns="">Missing &lt;wsse:Security&gt; in SOAP Header</faultstring><faultactor xmlns=""></faultactor></env:Fault></env:Body></env:Envelope>

            In all my previous apps, Ive just logged in to CRM OD using the functionality provided in the OnDemandWebService.Session class, then passed the Session URL directly into my query builder and queries ran without a hitch. Never needed to worry about manually controlling security in my generated soap requests.

            Any more ideas?
            Cheers,
            Mark
            • 3. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
              583340
              I normally pass authentication information with the SOAP request. You can see this in the sample request. I just tried passing a valid jsessionid without including wsse:security and received the same error that you mention.

              You might want to try using wsse:security instead of the HTTP GET approach.
              • 4. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                783894
                Thanks hody. The problem I'm having is that since I am not actually creating the SOAP request myself (C# based app build in visual studio), I have limited fine control over the construction of the request. I'm trying to find a way to incorporate wsse:security into my app, but everything I'm reading seems to suggest not only is this horribly complicated, but for the most part the methods that are available to do this don't actually work properly anyway.

                Non Administrative Services based requests, built via C#, dont require this level of rework. You just authenticate via the Oracle provided Session class, then pass the sessionid around as you need it to your various query building areas. However, the session class uses
                return httpBase + server + "/Services/Integration?command=login";
                and I am trying to use
                /Services/cte/FieldManagementService
                in my queries.

                I'm wondering is that why my authenticated session, which works for other apps, is not working here.
                • 5. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                  tipi
                  Mark,

                  Did you get this resolved? I am having the same issue as yours. If you did resolve this could you please post the code..

                  Thanks
                  • 6. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                    805445
                    I've had the same problem with VB.net and never could find it. How to insert a soap header into a request. Easy enough to do with Axis. I finally gave up and built the request with strings and used a HTTP object. Of course I had to parse up the return XML manually. Fortunatly it was a simple response.
                    • 7. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                      tipi
                      runndn2, can you please post the code if you dont mind. I have been working on this for the last 2 weeks and I am running out of options....
                      • 8. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                        805445
                        Snippits from a project. Simplest way I've found to make a CRMOD WS request.


                        Private oWebGlobalTimeQueryNoSession As New System.Net.WebClient()


                        Public Sub BuildTimeStringNoSession(ByVal username As String, ByVal password As String)
                        timeStringNoSession = "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" " & _
                        "xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" " & _
                        "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" " & _
                        "xmlns:wsse =""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"" " & _
                        "xmlns:time=""urn:crmondemand/ws/time/""> " & _
                        "<soapenv:Header><wsse:Security><wsse:UsernameToken>" & _
                        "<wsse:Username>" + username + "</wsse:Username>" & _
                        "<wsse:Password Type=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"">" & _
                        password + "</wsse:Password>" & _
                        "</wsse:UsernameToken></wsse:Security></soapenv:Header>" & _
                        "<soapenv:Body><time:TimeWS_GetServerTime_Input/></soapenv:Body></soapenv:Envelope>"

                        oWebGlobalTimeQueryNoSession.Headers = Nothing

                        oWebGlobalTimeQueryNoSession.Headers.Add("Content-Type", "text/xml;charset=UTF-8")
                        oWebGlobalTimeQueryNoSession.Headers.Add("User-Agent", "MSExcel")
                        oWebGlobalTimeQueryNoSession.Headers.Add("Accept", "text/xml")
                        oWebGlobalTimeQueryNoSession.Headers.Add("SOAPAction", """document/urn:crmondemand/ws/time/:GetServerTime""")
                        bytArgumentsNoSession = System.Text.Encoding.UTF8.GetBytes(timeStringNoSession)


                        Try
                             oWebGlobalTimeQueryNoSession.UploadData(serverName, "POST", bytArgumentsNoSession)
                             Catch ex As WebException
                             Try
                             Dim reader As StreamReader = New StreamReader(ex.Response.GetResponseStream)
                             errorStr = reader.ReadToEnd
                             b = errorStr.IndexOf("<ErrorMessage>")
                             e = errorStr.IndexOf("</ErrorMessage>")
                             errorStr = errorStr.Substring(b + 14, e - b - 14)
                             reader.Close()
                             reader = Nothing
                             Catch ex1 As Exception
                             '
                             End Try
                        End Try

                        End Sub
                        • 9. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                          tipi
                          I am getting the following error when I tried using your method as well as when I use httpwebrequest in C#

                          The remote server returned an error: (407) Proxy Authentication Required.

                          I am trying to consume an Administrative Service named Field Management. I am posting the code below... Please post any thoughts

                          One more thing: the soap envelop I am using works fine in SoapUI......


                          Dim oWebGlobalTimeQueryNoSession As New System.Net.WebClient()
                          Dim timeStringNoSession As Char()

                          timeStringNoSession = "<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:fiel=""urn:crmondemand/ws/odesabs/fieldmanagement/"" xmlns:quer=""urn:/crmondemand/xml/fieldmanagement/query""><soap:Header><wsse:Security xmlns:wsse=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"" soap:mustUnderstand=""1""><wsse:UsernameToken><wsse:Username>*******</wsse:Username><wsse:Password Type=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"">******</wsse:Password></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><fiel:FieldManagementRead_Input xmlns=""urn:/crmondemand/xml/fieldmanagement/query"" xmlns:ns2=""urn:/crmondemand/xml/fieldmanagement/data"" xmlns:ns3=""urn:crmondemand/ws/odesabs/fieldmanagement/""><FieldSet><ObjectName>Opportunity</ObjectName><IncludeAll>true</IncludeAll></FieldSet></fiel:FieldManagementRead_Input></soap:Body></soap:Envelope>"


                          oWebGlobalTimeQueryNoSession.Headers = Nothing


                          oWebGlobalTimeQueryNoSession.Headers.Add("Content-Type", "text/xml;charset=UTF-8")
                          oWebGlobalTimeQueryNoSession.Headers.Add("User-Agent", "MSExcel")
                          oWebGlobalTimeQueryNoSession.Headers.Add("Accept", "text/xml")
                          oWebGlobalTimeQueryNoSession.Headers.Add("SOAPAction", """document/urn:crmondemand/ws/time/:GetServerTime""")

                          oWebGlobalTimeQueryNoSession.UploadData("https://secure-ausomxfia.crmondemand.com/Services/cte/FieldManagementService", "POST", System.Text.Encoding.UTF8.GetBytes(timeStringNoSession))
                          • 10. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                            805445
                            Interesting that you can use soapUI and not have to use a proxy and I'm assuming when trying to run through visual studio you do? That doesn't seem right

                            Here is the proxy code that I've used and works.


                            Dim globalProxyObject As WebProxy = Nothing ' create a proxy object and pass it to the routines

                            globalProxyObject = New WebProxy(proxyhost, proxyport)

                            globalProxyObject.Credentials = New NetworkCredential(proxyuser, proxypassword)

                            req.Proxy = globalProxyObject
                            • 11. Re: SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header.
                              tipi
                              tks runndn2 for the help. finally I got this to work by manipulating the header using soap exceptions in c#.......