TL; DR Is it possible to create an โaliasโ for an IP address (for example, 0.0.0.0:8080/services
how SERVER_1
) or any other property in the contents of the WSDL when someone reads it? Similar to:
<entry key="org.apache.cxf.endpoint.private" value="true"/>
For a list of services that remains operational but hides the list of services.
If so, how? If not, is there a way to hide it without using it @XmlTransient
, because if we used it, and in my opinion, the program does not even display this element and, therefore, does not work anymore.
I work with SOAP services using Spring and JAX-RS.
We protect our applications, after a test for ethical hacking, the results obtained by us were that we showed services and produced IP addresses at our URLs.
We were able to hide the list of services from the web view, for example, if we turned to http://localhost:8080/foo/services
, we get this text:
No services have been found.
This is good, and we did it by executing this answer , but instead of being in the file cxf-servlet.xml
, it was in the file applicationContext-{moduleName}.xml
.
Now, if we know or have access to any of the WSDL paths, we can still see the contents of the WSDL (including production IP addresses), for example, if we entered:
http://localhost:8080/foo/services/bar?_wsdl
We have a similar definition, as shown below (I edited it for security reasons):
<application
xmlns="http://wsdl.dev.java.net/2009/02"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<grammars/>
<resources base="http://localhost:8080/foo/services/bar">
<resource path="/VX">
<resource path="/anotherPath">
<method name="POST">
<request>
<representation mediaType="application/x-www-form-urlencoded">
<param name="someParam" style="query" type="xs:string"/>
</representation>
</request>
<response>
<representation mediaType="application/json">
<param name="anotherParam" style="plain" type="xs:string"/>
</representation>
</response>
</method>
</resource>
</resource>
</resources>
</application>
How could I, for example, edit a property at runtime
<resources base="http://localhost:8080/foo/services/bar">
To something like
<resources base="SERVER_1">
, , IP- SERVER_1
, , , , , IP- ip ?
, 10 , IP-, , , , WSDL ( , , ).
, @XmlTransient
, docs:
/ JavaBean XML.
, , , IP-, .
, , ?
" " (.. WSDL, wsdl2java
Java Objects +)