SOAP XML Call Results in 400 Response -WHY?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • garyhartaz
    New Member
    • Feb 2010
    • 1

    SOAP XML Call Results in 400 Response -WHY?

    I am banging my head against the wall here. Can someone tell me if it is my code or could it be something on the server side?
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%
        Dim strTEST
    
        Dim objDOM
    
        set objDOM = Server.CreateObject("MSXML2.DOMDocument.4.0")
    
        objDOM.async=false
    
        strTEST = "<?xml version=""1.0"" encoding=""utf-8""?>"
    
        strTEST = strTEST & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" "
    
        strTEST = strTEST & "xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" "
    
        strTEST = strTEST & "xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
    
        strTEST = strTEST & "<soap:Body><InboundTraffic xmlns=""http://tempuri.org/""><request>" 
    
        strTEST = strTEST & "<MygrantXMLOrderingSystemRequest><RequestHeader><EnvironmentID>TEST</EnvironmentID>" 
    
        strTEST = strTEST & "<CustomerID>C012949-001</CustomerID><CustomerContact>RobS</CustomerContact><WebUserID>broadtest</WebUserID>"
    
        strTEST = strTEST & "<Password>password</Password><PurchaseOrderNo>PO12345</PurchaseOrderNo><OrderDeliveryNote>Buyer Comment</OrderDeliveryNote><RequestType>Inquiry</RequestType><VersionNumber>1.0</VersionNumber></RequestHeader>"
    
        strTEST = strTEST & "<RequestSet><RequestItem><RequestItemNo>1</RequestItemNo><RequestDetail><RequestNAGSPrefix>DW</RequestNAGSPrefix><RequestNAGSNumber>01206</RequestNAGSNumber><RequestNAGSColor>GB</RequestNAGSColor><RequestNAGSHardwareIndicator>Y</RequestNAGSHardwareIndicator><RequestNAGSPremiumIndicator>N</RequestNAGSPremiumIndicator><RequestBrand>FYG</RequestBrand><RequestQuantity>1</RequestQuantity><OrderLineDeliveryNote>This is a test order, glass</OrderLineDeliveryNote></RequestDetail></RequestItem><RequestItem><RequestItemNo>2</RequestItemNo><RequestDetail><RequestProductID>BKT 6856</RequestProductID><RequestBrand>PER</RequestBrand><RequestQuantity>1</RequestQuantity><OrderLineDeliveryNote>This is a test order, moulding</OrderLineDeliveryNote></RequestDetail></RequestItem></RequestSet><RequestStatusCode>0</RequestStatusCode><RequestStatusText>Success</RequestStatusText></MygrantXMLOrderingSystemRequest>"
    
        strTEST = strTEST & "</request></InboundTraffic></soap:Body>"
    
        strTEST = strTEST & "</soap:Envelope>"
    
        objDOM.loadXML(strTEST)
    
        Set oXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0") 
    
        Call oXMLHTTP.setTimeouts(60000, 60000, 300000, 300000)
    
        oXMLHTTP.Open "POST","http://75.21.47.101/CoRE650WebService/CoRE650WebService/CoRE650WebService.asmx", false 
    
        oXMLHTTP.SetRequestHeader "Content-Type", "text/xml; charset=utf-8"
    
        oXMLHTTP.SetRequestHeader "Content-length", len(strTEST) 
    
        oXMLHTTP.SetRequestHeader "SOAPAction", "http://tempuri.org/InboundTraffic" 
    
        oXMLHTTP.send objDOM.xml
        
        'TEST
        response.write "  Response=" &  oXMLHTTP.status & "**"
        response.write "  Response status=" &  oXMLHTTP.statusText & "**"
        strResult = "Response text: " & oXMLHTTP.responseText & "**"
        response.write strResult 
        response.write "  Response header=" &  oXMLHTTP.getAllResponseHeaders & "**"
        response.End  
        %>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        </form>
    </body>
    </html>
    Last edited by Frinavale; Feb 23 '10, 03:33 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello garyhartaz,

    No one says it better then tlhintoq: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

    Happy Coding,
    CroCrew~

    Comment

    • CroCrew
      Recognized Expert Contributor
      • Jan 2008
      • 564

      #3
      Hello garyhartaz,

      Also I noticed that this question needs to be moved to the "ASP.net" forum. This forum is for Classic ASP questions.


      Happy Coding,
      CroCrew~

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        This really doesn't look like ASP.NET code to me.
        I have not seen this type of syntax.

        A 400 error means that you have made a "Bad Request".
        Please check your SOAP and double check your URL to the service

        -Frinny

        Comment

        Working...