• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5255
  • Last Modified:

Web service call failing on SOAP error 400 - malformed syntax - what does this return header tell me?

Hello all,

I am trynig to complete a web service call from script in an enterprise application, however I keep getting back a responseCode of 400. I perused the return headers and all that is coming back is:

Content-LengthX-Powered-ByX-AspNet-VersionMicrosoftOfficeWebServerDateServerCache-Control

...and when I write out the return code, it is:
returnCode: 400

Can anyone tell me what the above return header is complaiing about? I have included the Content-Length header as follows in the Ws call:

soapHeaders['Content-Length'] = '200';*


In the framwework I am using SOAP headers are all put into an array. The above header seems to be what is causing my Ws call to fail. Can anyone shed some light on what I can try to fix this?


Thanks a million! I appreciate any and all help on this.

-oddic
0
OddiC
Asked:
OddiC
  • 7
  • 4
1 Solution
 
Bob LearnedCommented:
That can sometimes be that your content contains invalid characters for a SOAP response.

Bob
0
 
OddiCAuthor Commented:
Here is my SOAP payload and headers (I don't think anything would be invalid..(?)):


<code>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CreateObj xmlns="https://services.ee.com:448/CreateObj/">
<xml>
<?xml version="1.0" encoding="utf-8" ?>
<Obj>
<Num>7777</Num>
<Name>TEST</Name>
<NNum>77777</NNum>
<DName>TEST -!!!</DName>
<Type>T/Y</Type>
<Location>ABCD</Location>
<Status>01 - Active</Status>
<lManager>Test Mgr</Manager>
<DateEstStart>6/16/2007</DateEstStart>
<DateEstEnd>6/23/2007</DateEstEnd>
<Media>Web</Media>
<Files>91</Files>
</Deal>
</xml>
</CreateObj>
</soap:Body>
</soap:Envelope>

</code>

Content-Length: 500
Content-Type: text/xml; charset=utf-8
Host: localhost
SOAPAction: https://services.ee.com:448/CreateObj
0
 
Bob LearnedCommented:
Is this standard Web Service stuff, or are you working with non-standard elements, like Java web service, special SOAP headers, etc.?

Bob

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
OddiCAuthor Commented:
The call is made using a propriety JS framework. The payLoad and headers I have listed are standard web service stuff- the web service call is going through just fine. But, for whatever reason, the web service is rejecting my SOAP request returning code 400 (and the header I listed). It seems that this is a syntax issue, but I can't find anything wrong with my request and headers- they should be exactly what the Ws expects according to its wsdl.

It just makes me think that Content-Length is the culprit because that is indicated in the response header. I searched everywhere I could think of for:

"Content-LengthX-Powered-ByX-AspNet-VersionMicrosoftOfficeWebServerDateServerCache-Control"

and could not find anything.

0
 
OddiCAuthor Commented:
Also FYI: The web service is a .NET web sevice hosted on a WinServer running IIS 6.0
0
 
OddiCAuthor Commented:
After some more digging I determined 'Content-Length' just means the response has no body. Here are all of the response headers and their values. Why am I getting a 400 error? I have verified the SOAP envelope and headers against the service spec..(?):

Content-Length: 0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
MicrosoftOfficeWebServer: 5.0_Pub
Date: Fri, 12 Oct 2007 16:22:20 GMT
Server: Microsoft-IIS/6.0
Cache-Control: private
 
Return Code: 400
0
 
Bob LearnedCommented:
1) Is this your web service or a 3rd party?

2) Does this web service work for other things?  

Bob
0
 
OddiCAuthor Commented:
This is my web service yes. And it has been tested and tested, and works just fine. I have called it from other client apps (including NUnit running on a client, from the server itself (using 'Invoke' which is available on the IIS host), and I have accessed it from the outside). I keep getting return code of 400 when I call it from this enterprise server script, and I have no idea why?

Would this be speifically related to the SOAP envelope syntax or might this be the case of a missing header instead?

Thanks in advance!
0
 
Bob LearnedCommented:
I don't have a clue about your environment yet, so it is difficult to even guess.  What do you mean by "enterprise server script"?  Is this your own hand-craft script code?

Bob
0
 
OddiCAuthor Commented:
Forget about the enterprise app- Just assume that I am accessing this web service from a local app on my machine. The web service call is going through just fine- however, the return code indicates the SOAP request (posted byte stream) has invalid syntax.

The only thing I can think of is i nthe spec page (the http://localhost:81/WebService/Service.asmx?op=CreateDmsDeals), it shows the following right above the SOAP envelope (I KNOW my envelope in properly formed),

POST /WebService/Service.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://services.ee.com:448/Service"


I am including all of the headers above except 'POST /WebService/Service.asmx HTTP/1.1

... I do believe that's not even a header, right?

Anywho.. I will keep debugging. I am determined to find out what the service doesn't like.
0
 
OddiCAuthor Commented:
I solved my problem (but ran into something new- will post another question). The issue had to do with the parameter in the soap envelope:

 var soap = '';
    soap += '<soap:Body>';
        soap += '<Obj xmlns="https://public.facing.url:448/">';
        soap += '<xml>'+xml+'</xml>';

it had to be changed to the internal name:

 var soap = '';
    soap += '<soap:Body>';
        soap += '<Obj xmlns="https://[servername]:448/">';
        soap += '<xml>'+xml+'</xml>';

Thanks for all the help!
0
 
low5Commented:
need a error 400 fix
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now