I have this message
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Schema validated fine, but the SOAP UI tool, when click on "Check WS-I Compliance", it gives a failed status with BP1305 assertion fail. I can't find what 1305 is and this is the detailed message
Result
failed
Failure Detail Message
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Thu, 22 Jul 2010 20:41:43 GMT
Set-Cookie: JSESSIONID=C9D19FE6AAD89DFCB6BA9FE196E08D40; Path=/
Content-Type: text/xml;charset=utf-8
Server: Apache-Coyote/1.1
Element Location:
lineNumber=26
The problem seems to be that you are returning a SOAP Fault message, but with a HTTP status code of 200, SOAP Faults are required to be sent with a HTTP status code of 500.
You are missing the detail element in your fault message. It is a required element if the wsdl fault is produced as a results of the contents of the body element in the request
The message should be like this (detail element should contain application specific info. But it is acceptable to be empty. Not acceptable to be missing):
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
<detail></detail>
</soapenv:Fault>
Related
I want to consume a SOAP Webservice from Dynamics NAV 2013 R2 via
http://servername:7047/DynamicsNAV71/WS/CRONUS%20AG/Codeunit/WSInterface
I can visit this page only via Chrome and it asks me for credentials (which are correct and working).
If I'm logged with Crome and start Postman I'm able to consume it:
POST /DynamicsNAV71/WS/CRONUS%20AG/Codeunit/WSInterface HTTP/1.1
Host: servername:7047
Content-Type: text/xml
SOAPAction: urn:microsoft-dynamics-schemas/codeunit/WSInterface:Process
Cache-Control: no-cache
Postman-Token: 5e640ab7-d0af-a098-0665-da4fa281f892
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsin="urn:microsoft-dynamics-schemas/codeunit/WSInterface">
<soapenv:Header/>
<soapenv:Body>
<wsin:Process>
<wsin:request>INPUT</wsin:request>
<wsin:response>FAKE_RESPONSE</wsin:response>
</wsin:Process>
</soapenv:Body>
</soapenv:Envelope>
and get statuscode 200 OK as response.
As soon, as I close the Chrome browser and send the request again I get the Status 401 (Unauthorized), so I add the Authorization header. After that I get the Status 400 with following headers:
POST /DynamicsNAV71/WS/CRONUS%20AG/Codeunit/WSInterface HTTP/1.1
Host: servername:7047
Content-Type: text/xml
SOAPAction: urn:microsoft-dynamics-schemas/codeunit/WSInterface:Process
Authorization: NTLM YWNhbVxncnU6Z3J1MTIzNA==
Cache-Control: no-cache
Postman-Token: 595777b7-5183-38d3-d49b-6bc5d4e3d30e
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsin="urn:microsoft-dynamics-schemas/codeunit/WSInterface">
<soapenv:Header/>
<soapenv:Body>
<wsin:Process>
<wsin:request>INPUT</wsin:request>
<wsin:response>FAKE_RESPONSE</wsin:response>
</wsin:Process>
</soapenv:Body>
</soapenv:Envelope>
Nothing changed beside the Authorization header, so why do I get the Status 400? Can somebody help?
If I'm logged in with Chrome the Authorization header doesn't matter if sent or not...
NTLM authentication is not supported by postman, you can use Fiddler or your chrome browser for authentication. https://github.com/postmanlabs/postman-app-support/issues/1137
Axis2 by default is send a multipart response even when there are no attachments
Why is axis2 sending a multipart response & how to ask it to send a "application/xml" or "application/soap+xml" how to get rid of multipart?
In the axis2.xml I have
In the response I see
HTTP/1.1 200 OK
Date: Fri, 17 Feb 2017 01:07:08 GMT
Transfer-Encoding: chunked
Content-Type: multipart/related; boundary="MIMEBoundary_87162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b"; type="application/xop+xml"; start="<0.97162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b#apache.org>"; start-info="text/xml"
--MIMEBoundary_87162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.97162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b#apache.org>
200<?xml version="1.0" encoding="UTF-8"?>
<List_Wrapper>
<_bp>
<_comments><_comment><content>Again a new comment this is a text type bp comment need to see this in the text json 1</content><published_date>2017-01-18T21:07:15</published_date><published_by>cyril furtado</published_by><company>Chevron Inc.</company></_comment></_comments></_bp>
</List_Wrapper>
--MIMEBoundary_87162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b-
I too faced similar issue for AXIS 2 quite recently , so thought to answer this.
AXIS 2 by default support attachment processing globally, which might not be needed for all types of services. To resolve this issue I disabled MTOM processing globally by modifying axis2.xml file -
<parameter name="enableMTOM">false</parameter>
This capability can now be enabled on need basis per service basis by enabling this property via respective services.xml file
I have created a soapui project to test this wsdl
When sending this request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:x/="http://www.w3schools.com/xml/">
<soapenv:Header/>
<soapenv:Body>
<x/:CelsiusToFahrenheit>
<!--Optional:-->
<x/:Celsius>30</x/:Celsius>
</x/:CelsiusToFahrenheit>
</soapenv:Body>
I get bad request in raw response
HTTP/1.1 400 Bad Request
Cache-Control: private,public
Content-Type: text/xml; charset=utf-8
Date: Sun, 28 Feb 2016 17:33:28 GMT
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Content-Length: 0
The error is so trivial due to the special character in the namespace (x/), which can be found by Validating the request( clicking keys 'Alt+v` in the request editor)
Could not figure it out that why such special character is coming when soapUI generates the request
What should be done in order to make the request valid?
Please change the request to below(replaced x/ to x):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:x="http://www.w3schools.com/xml/">
<soapenv:Header/>
<soapenv:Body>
<x:CelsiusToFahrenheit>
<x:Celsius>30</x:Celsius>
</x:CelsiusToFahrenheit>
</soapenv:Body>
</soapenv:Envelope>
Below is the screen shot of successful response upon changing the request as above.
I'm invoking a REST service from an OSB Proxy Service, which is working fine if the rest service response is a valid response, i.e., there's no errors. However if the rest service replies with an http error code (e.g. 400 Bad Request), I'm not able to capture anything else except the http error code:
$fault variable in OSB:
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-382502</con:errorCode>
<con:reason>
OSB Service Callout action received an error response
</con:reason>
<con:details>
<con1:ErrorResponseDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
<con1:http-response-code>400</con1:http-response-code>
</con1:ErrorResponseDetail>
</con:details>
<con:location>
<con:node>PipelinePairNode1</con:node>
<con:pipeline>PipelinePairNode1_request</con:pipeline>
<con:stage>stage1</con:stage>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>
But the rest service, is not only replying with 400 Bad Request, but also adding a message:
<Error>
<Message>The message header contains an invalid brand code.</Message>
</Error>
Which I'm not able to process in my proxy service. Does anyone knows if it is possible to access this message details in OSB or is it a limitation?
The rest service is clearly sending the message, because invoking it directly through soap-ui I'll get the following response:
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 84
Content-Type: application/xml; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 09 Feb 2015 16:15:32 GMT
<Error><Message>The message header contains an invalid brand code.</Message></Error>
Thanks
I've just found out this is an OSB bug, in case of an HTTP Error code 400 being returned, if the http-content is "Application/XML" the message is ignored.
Oracle released a Patch at the end of last month to fix this issue, which I've tested and it works. I can get the message details in the $body variable now.
Patch: 16986497
If I understand your question, you want to get in addition to the http code, the message error?
I think you should use, in your message flow, an errorHandler , so that you can catch the error and do whatever you want with.
The proxy service operation selection algorithm cannot determine the operation name from the request or returns an invalid operation (one which is not in the WSDL or null). Possible reasons include the following:
An error occurs while computing the operation.
The operation selection algorithm returns null.
The operation selection algorithm returns an operation that is not of the of the operations declared by the WSDL.
Source
I am trying to test a Rest service through HTTP sampler using Jmeter. The first sampler generates a token and I am using this token for authorization in the header manager of another HTTP sampler "GetUserandPolicies"(Rest WS request) using RegEx and ForEach controller. I can see in the view results tree that RegEx is working fine passing the actual token to the next request. But the Rest Request is failing giving a response message as Forbidden and Response Code 403 which means that the server is able to recognise the request but denying the access.There is no port number for this HTTP sampler which I suspect would be the culprit. But, the same test is passing with another tool (iTKO LISA) without any port value. Both the samplers "TokenGeneration" and "GetUserandPolicies" have no port values. I need some help on this. I am using the POST method in the HTTP sampler
Please find the sampler result:
Thread Name: Thread Group 1-1
Sample Start: 2014-01-13 12:12:29 IST
Load time: 1390
Latency: 1390
Size in bytes: 382
Headers size in bytes: 354
Body size in bytes: 28
Sample Count: 1
Error Count: 1
Response code: 403
Response message: Forbidden
Response headers:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization, X-Requested-With, Content-Type
Content-Type: text/plain;charset=UTF-8
Content-Length: 28
Date: Mon, 13 Jan 2014 06:42:30 GMT
HTTPSampleResult fields:
ContentType: text/plain;charset=UTF-8
DataEncoding: UTF-8
Looking into Access-Control-Allow-Headers: Authorization, X-Requested-With, Content-Type stanza I guess that you're missing proper Authorization header.
In regards to empty port everything is fine, it defaults to port 80 in case of HTTP and 443 in case of HTTPS
There are 2 options on how you can deal with Basic HTTP Authentication:
Pass username and password in URL like protocol://username:password#host:port/path
i.e. http://user:pass#your.server.com/somelocation
Use JMeter HTTP Authorization Manager to construct required "Authorization" header for you.
In case if your authentication system uses other approaches, i.e. Cookie-based, NTLM or Kerberos it's still possible but a little bit more tricky. If so - update this post with all details you can get (i.e. request details) and don't hesitate to leave a comment requesting for more input