Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moco close the connection after receive a soap request #74

Open
Neway6655 opened this issue Apr 10, 2014 · 5 comments
Open

Moco close the connection after receive a soap request #74

Neway6655 opened this issue Apr 10, 2014 · 5 comments

Comments

@Neway6655
Copy link

very interesting issue, I use moco to simulate a webservice server, and found that moco will close the connection after soap response returned back to the client although there was the "Connection: keep-alive" header in the request.

@Neway6655
Copy link
Author

BTW, I am using version 0.8.1

@Neway6655
Copy link
Author

I found there was a blog http://dreamhead.blogbus.com/tag/moco/, but that's about 'Content-Length' header not returned situation, while in this case, I found the Content-Length was returned, so it seems a different issue, and I have tested even I upgrade to 0.9.1, this issue still there.
BTW, i am using CXF as the webservice client.

@dreamhead
Copy link
Owner

Could you please inspect your request/response? I need more information for further action.

@Neway6655
Copy link
Author

Here is moco server configuration code:
server.post(eq(xpath("//*[local-name()='userId']/text()"), "ema-user-id")).response(
with(pathResource("data/session_login_response.xml")), header("Content-Type", "text/xml"));

Request:
POST /cai3g1.2/services/cai3g1.2/SessionControl?wsdl HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Accept: /
SOAPAction: "CAI3G#Login"
User-Agent: Apache CXF 2.6.0
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:8088
Connection: keep-alive
Content-Length: 267

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Login xmlns="http://schemas.ericsson.com/cai3g1.2/" xmlns:ns2="http://schemas.ericsson.com/ma/nonSIM/"><userId>ema-user-id</userId><pwd>ema-pwd</pwd></Login></soap:Body></soap:Envelope>

Response:
HTTP/1.1 200 OK
Content-Length: 352
Content-Type: text/xml

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
.xmlns:cai3="http://schemas.ericsson.com/cai3g1.2/">
   <soap:Header/>
   <soap:Body>
      <cai3:LoginResponse>
         <cai3:sessionId>10002</cai3:sessionId>
         <cai3:baseSequenceId>123456</cai3:baseSequenceId>
      </cai3:LoginResponse>
   </soap:Body>
</soap:Envelope>

Please let me know if you need more info.

@Neway6655
Copy link
Author

Interesting, if I use soapUI or chrome Dev HTTP Client plugin to send the request (even with the same request header and body), moco server response correctly with keep-alive worked. But if I changed to use the code (webservice client generated by cxf) to send the same request, moco server seems close the connection positively. Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants