Skip to main content

java.lang.Error: Undefined operation name "

2 replies [Last post]
russ_ray
Offline
Joined: 2006-11-23

I am hoping someone can point me in the right direction....

What I have is a WSDL created for a Web Service. I have taken this WSDL and using JAX-WS I created a client for calling the web service defined in the WSDL.

The WSDL validates with no problems. All the classes area created in the client. Now I am trying to call one method. When I make the call, I receive: "java.lang.Error: Undefined operation name " When I go look at the PortType class, I see the method. When I turn on the TCP/IP Montor, I see the WSDL is being pulled down.

My Client code looks like this......

<br />
public static void main(String[] args){<br />
		MyWebServicePortType client = new MyWebService().getMyWebServiceHttpPort();<br />
        ObjectFactory of = new ObjectFactory();</p>
<p>		MyFileSearchCriteria criteria = of.createMyFileSearchCriteria();<br />
		criteria.setMyCollection(of.createMyCollectionName("Test"));<br />
		logger.debug("Criteria: " + criteria.toString());<br />
		ArrayOfMyFile files = client.searchMyFiles(criteria);</p>
<p>		logger.debug("Array of My Files: " + files.toString());</p>
<p>	}</p>
<p>

This is the stack trace:

<br />
java.lang.Error: Undefined operation name SearchMyFiles<br />
	at com.sun.xml.ws.model.JavaMethodImpl.freeze(JavaMethodImpl.java:327)<br />
	at com.sun.xml.ws.model.AbstractSEIModelImpl.freeze(AbstractSEIModelImpl.java:97)<br />
	at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:268)<br />
	at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:633)<br />
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:328)<br />
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:311)<br />
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:304)<br />
	at javax.xml.ws.Service.getPort(Service.java:92)</p>
<p>

Any suggestions would be greatly appreciated.

Thanks for taking the time to read my post......

Russ

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
russ_ray
Offline
Joined: 2006-11-23

I have some searching in the PortType class and it appears the annotations may have something to do with this issue. I modified the operationName to searchMyFiles and I was able to get by the error. However, all it did was move onto the next method.

[code]
@WebMethod(operationName = "SearchMyFiles")
@WebResult(name = "out", targetNamespace = "http://service.server.my.project.company.com")
@RequestWrapper(localName = "SearchMyFilesRequest", targetNamespace = "http://service.server.my.project.company.com", className = "mil.project.my.client.SearchMyFiles")
@ResponseWrapper(localName = "SearchMyFilesResponse", targetNamespace = "http://service.server.my.project.company.com", className = "mil.project.my.client.SearchMyFilesResponse")
[/code]

My understanding is the @webMethod should possess the operation name as it is found in the WSDL, but for some reason, the getPort method is attempting to bind all the operations described through annotations and it is not finding it......

Suggestions?

Russ

bennid
Offline
Joined: 2009-05-22

Hey Russ,

I'm running into the same thing... however -- even after putting the operationName in, it still errors... do you have a dump of what your WebService class shows in the client source?

-Ben