cancel
Showing results for 
Search instead for 
Did you mean: 

how to use a Web Service Proxy from a different DC?

former_member190457
Contributor
0 Kudos

Hi developers,

In EJB DC "dc1" I have imported a wsdl and generated proxies and service group.

In public part "compilation" of dc1 I have added all the generated proxy classes and the wsdl from META-INF/wsdl folder

EJB DC "dc2" depends on this public part (also on the mcjar public part which should hold info on the Service Group).

Here I would like to use the proxy classes defined in "dc1" to invoke the WS in my WSConsumer StatelessEJB like this:


@Stateless
public class WSConsumerBean implements WSConsumerLocal {

	@WebServiceRef
	ZWSWORKSHOP1 service;

	public ArrayOfString testWS() {
		ZWSWORKSHOP1ViDocument port = service
				.getPort(ZWSWORKSHOP1ViDocument.class);
		ArrayOfString retVal = port.doOperation();
		return retVal;
	}

}

After deploying the EAR with both the proxy and the ejb, when I try to invoke the EJB injection fails:


 javax.xml.ws.WebServiceException: JAX-WS deployable proxy is instantiated with 'new' instead of been injected. Cannot find WSDL URL for service [class zws_workshop1wsd.ZWSWORKSHOP1] 

Can someone help?

Thanks, regards

Vincenzo

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190457
Contributor
0 Kudos

A solution is to use JNDI lookup in EJB.

Instantiate a InitialContext and lookup the JNDI entry with the lookup String you can find in NWA -> JNDI browser

Have fun!

Thanks, regards

Vincenzo