[jboss-user] [JBoss Web Services] - Re: My WebService Client always gets "Connection refused" Exception
Matthias M.
do-not-reply at jboss.com
Wed Sep 5 09:12:31 EDT 2012
Matthias M. [https://community.jboss.org/people/virtuellesnugat] created the discussion
"Re: My WebService Client always gets "Connection refused" Exception"
To view the discussion, visit: https://community.jboss.org/message/758061#758061
--------------------------------------------------------------
After I found out, thanks to wireshark, that the client tried to address localhost instead of the specified location, I knew what happened:
In the generated wsdl was the following part included:
{code:xml}
<wsdl:service name="AppointmentFacadeService">
<wsdl:port binding="tns:AppointmentFacadeServiceSoapBinding" name="AppointmentFacadePort">
<soap:address location=" http://localhost:8080/wsServe/AppointmentFacade http://localhost:8080/wsServe/AppointmentFacade"/>
</wsdl:port>
</wsdl:service>
{code:xml}
As my server is running on a vm, it's pretty obvious what caused the problem.
I was able to solve it by editing the standalone-full.xml
{code:xml}
<subsystem xmlns="urn:jboss:domain:webservices:1.1">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>192.168.178.121</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>
<endpoint-config name="Recording-Endpoint-Config">
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
</pre-handler-chain>
</endpoint-config>
</subsystem>
{code:xml}
This way, the above mentioned part of the wsdl was changed to this:
{code:xml}
<wsdl:service name="AppointmentFacadeService">
<wsdl:port binding="tns:AppointmentFacadeServiceSoapBinding" name="AppointmentFacadePort">
<soap:address location=" http://192.168.178.121:8080/wsServe/AppointmentFacade http://192.168.178.121:8080/wsServe/AppointmentFacade"/>
</wsdl:port>
</wsdl:service>
{code:xml}
And now my java se client addresses the correct service, though it picked the correct url to retrieve the wsdl.
I still got two questions left:
1. Why was SoapUI able to call the correct service? I know, I had to edit the interface endpoint by changing the url. But which method can I use to change it manually on client side in the java code?
2. It seems to be a very bad style to hardcode the machine's url into the configuration file in order to get the expected wsdl created. Is there a constant I can use like "{jboss-external-ipv4-address}"?
Best regards, Matthias
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/758061#758061]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120905/e097c387/attachment.html
More information about the jboss-user
mailing list