[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1149
  • Last Modified:

SOAP WSDL creation & Proxy

I have created a java webservice, and deployed it on my JBoss application server. Because I don't want the JBoss server to be exposed directly to the internet, I make use of an Apache HTTP server in front of this JBoss application server. In Apache I am using the ProxyModule to redirect the requests form the clients to the JBoss application server.

When I go the the webservice and request the WSDL (that is automatically generated by the webservice), the location of the service in the WSDL file is the url of the service in the internal network (http://localhost:8080/ws/MyService).

How can I receive the external URL of the service?
@WebService(targetNamespace = "http://myservice.soap.mypackage.be/")
public class MyService implements MyServiceIf {
	@WebMethod
	public Long postBarcode(@WebParam(name = "code", targetNamespace = "http://myservice.soap.mypackage.be/") String code) throws Exception {
		// Code
	}
}

Open in new window

0
serrutom
Asked:
serrutom
  • 3
  • 2
1 Solution
 
Gibu GeorgeCTOCommented:
You need to configure the apache http server to redirect the request to your webservices internal url
0
 
serrutomAuthor Commented:
The redirect is ok, my application is accessible, but the url in the generated WSDL file is incorrect. The WSDL file gives me the internal server url, but i need the external server url.

Can i fix this with an annotation? A parameter? ...
I get
 
...
<service name="StockManagementServiceBeanService">
   <port binding="tns:StockManagementServiceBeanBinding" name="StockManagementServiceBeanPort">
      <soap:address location="http://192.168.1.10:8180/ws/MyService"/>
   </port>
</service>
...
 
I want to receive
 
...
<service name="StockManagementServiceBeanService">
   <port binding="tns:StockManagementServiceBeanBinding" name="StockManagementServiceBeanPort">
      <soap:address location="http://www.myurl.be/ws/MyService"/>
   </port>
</service>
...

Open in new window

0
 
Gibu GeorgeCTOCommented:
No you need to modify the the http.conf file to achieve that
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Gibu GeorgeCTOCommented:
use

Redirect /ws/MyService http://192.168.1.10:8180/ws/MyService

 in httpd.conf
0
 
serrutomAuthor Commented:
It's the other way around I want it to work.

The redirect is working just fine right now by using:

<location /ws>
   ProxyPass http://192.168.1.10:8180/ws
   ProxyPassReverse http://192.168.1.10:8180/ws
</location>

I don't want to make the redirect, i want my WSDL file to return me the correct URL to the service, and not the URL like I would be able to use on my internal network. The url in my WSDL file should be 'http://www.mydomain.be/ws' and not 'http://192.168.1.10:8180/ws'

Or do I understand your answer incorrectly?
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
I would better say handle this in the webservice itself as the WSDL is dynamically generated by the JAX-WS you can follow this link to set your custom WSDL with modified endpoint.

http://forums.java.net/jive/message.jspa?messageID=335730 

 in simple terms you may need to add one more attribute to @WebService annotation
wsdlLocation = "/WEB-INF/wsdl/service.wsdl"

but i think JbossWS has its own dynamic endpoint,

check:http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4163296#4163296
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now