11 Replies Latest reply: Jul 30, 2007 7:51 PM by Christopher Stokes RSS

"Endpoint does not contain operation metadata" exception

Christopher Stokes Newbie

Hello all. I've been stuck on this problem for 3 days now and it is driving me crazy. I originally had just one web method exposed as a web service and everything worked fine. I added an additional method and while the first operation still works... the second one throws a "Endpoint does not contain operation metadata" exception when it gets called.

This is running on jboss-4.2.0.GA with jbossws 1.2.1 GA.

WSDL:

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions name="XmlApiMethods" targetNamespace="xmlapi_1.0"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns:tns="xmlapi_1.0"
 xmlns="http://schemas.xmlsoap.org/wsdl/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

 <wsdl:types>
 <xsd:schema targetNamespace="xmlapi_1.0"
 elementFormDefault="qualified"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="find" type="tns:find_t" />
 <xsd:element name="findResponse" type="tns:findResponse_t" />
 <xsd:complexType name="find_t">
 <xsd:sequence>
 <xsd:element name="fullClassName" type="xsd:string" minOccurs="1" />
 <xsd:element name="filter" type="xsd:string" minOccurs="1" />
 <xsd:element name="resultFilter" type="xsd:string" minOccurs="0" />
 </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="findResponse_t">
 <xsd:sequence>
 <xsd:element name="result" type="xsd:string" minOccurs="1" />
 </xsd:sequence>
 </xsd:complexType>

 <xsd:element name="ping" type="tns:ping_t" />
 <xsd:element name="pingResponse" type="tns:pingResponse_t" />

 <xsd:complexType name="ping_t">
 <xsd:sequence/>
 </xsd:complexType>

 <xsd:complexType name="pingResponse_t">
 <xsd:sequence/>
 </xsd:complexType>
 </xsd:schema>
 </wsdl:types>

 <wsdl:message name="FindInterface_find">
 <wsdl:part name="parameters" element="tns:find" />
 </wsdl:message>
 <wsdl:message name="FindInterface_findResponse">
 <wsdl:part name="result" element="tns:findResponse" />
 </wsdl:message>

 <wsdl:message name="FindInterface_ping">
 <wsdl:part name="parameters" element="tns:ping" />
 </wsdl:message>
 <wsdl:message name="FindInterface_pingResponse">
 <wsdl:part name="result" element="tns:pingResponse" />
 </wsdl:message>

 <wsdl:portType name="FindInterface">
 <wsdl:operation name="find">
 <wsdl:input message="tns:FindInterface_find" />
 <wsdl:output message="tns:FindInterface_findResponse" />
 </wsdl:operation>

 <wsdl:operation name="ping">
 <wsdl:input message="tns:FindInterface_ping" />
 <wsdl:output message="tns:FindInterface_pingResponse" />
 </wsdl:operation>
 </wsdl:portType>

 <wsdl:binding name="FindInterfaceBinding"
 type="tns:FindInterface">
 <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
 style="document" />
 <wsdl:operation name="find">
 <soap:operation soapAction="" />
 <wsdl:input>
 <soap:body use="literal" />
 </wsdl:input>
 <wsdl:output>
 <soap:body use="literal" />
 </wsdl:output>
 </wsdl:operation>

 <wsdl:operation name="ping">
 <soap:operation soapAction="" />
 <wsdl:input>
 <soap:body use="literal" />
 </wsdl:input>
 <wsdl:output>
 <soap:body use="literal" />
 </wsdl:output>
 </wsdl:operation>
 </wsdl:binding>

 <wsdl:service name="XmlApiMethods">
 <wsdl:port name="FindInterfacePort"
 binding="tns:FindInterfaceBinding">
 <soap:address location="REPLACE_WITH_ACTUAL_URL" />
 </wsdl:port>
 </wsdl:service>
</wsdl:definitions>


Interface:

package webservice;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

@WebService(name = "FindInterface", targetNamespace = "xmlapi_1.0")
//@XmlSeeAlso({
// ObjectFactory.class
//})
public interface FindInterface {


 /**
 *
 * @param filter
 * @param fullClassName
 * @param resultFilter
 * @return
 * returns java.lang.String
 */
 @WebMethod
 @WebResult(name = "result", targetNamespace = "xmlapi_1.0")
 @RequestWrapper(localName = "find", targetNamespace = "xmlapi_1.0", className = "webservice.FindT")
 @ResponseWrapper(localName = "findResponse", targetNamespace = "xmlapi_1.0", className = "webservice.FindResponseT")
 public String find(
 @WebParam(name = "fullClassName", targetNamespace = "xmlapi_1.0")
 String fullClassName,
 @WebParam(name = "filter", targetNamespace = "xmlapi_1.0")
 String filter,
 @WebParam(name = "resultFilter", targetNamespace = "xmlapi_1.0")
 String resultFilter);

 /**
 *
 */
 @WebMethod
 @RequestWrapper(localName = "ping", targetNamespace = "xmlapi_1.0", className = "webservice.PingT")
 @ResponseWrapper(localName = "pingResponse", targetNamespace = "xmlapi_1.0", className = "webservice.PingResponseT")
 public void ping();

}


Implementation snippet:
package webservice;

@WebService(name = "FindInterface", serviceName = "XmlApiMethods",
 portName = "FindInterfacePort",
 targetNamespace = "xmlapi_1.0",
 wsdlLocation = "META-INF/wsdl/XmlApiMethods.wsdl" ,
 endpointInterface = "webservice.FindInterface")

public class FindImpl implements FindInterface { ...


Bit of code that generates the ping request (raw request). This is what currently fails. The client uses something very similar and cannot be changed:
public static String getPingRequest(String user, String password, String clientId) {
 return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
 "<SOAP:Envelope "+
 "xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
 "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
 "<SOAP:Header><header xmlns=\"xmlapi_1.0\">" +
 "<security><user>" + user +
 "</user><password>"+ password +
 "</password></security><requestID>"+clientId+"</requestID>"+
 "</header></SOAP:Header>"+
 "<SOAP:Body><ping xmlns=\"xmlapi_1.0\"/></SOAP:Body></SOAP:Envelope>";
 }


The find bit of code that currently works:
public static String getSoapRequest(String user, String password, String clientId,
 String root) {
 return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
 "<SOAP:Envelope "+
 "xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\" "+
 "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"+
 "<SOAP:Header><header xmlns=\"xmlapi_1.0\">\n"+
 "<security><user>" + user +
 "</user><password>"+ password +
 "</password></security><requestID>"+clientId+"</requestID>\n"+
 "</header></SOAP:Header>"+
 "<SOAP:Body><find xmlns=\"xmlapi_1.0\">"+
 "<fullClassName>"+root+"</fullClassName>"+
 "<filter/>"+
 "<resultFilter><children/></resultFilter>"+
 "</find></SOAP:Body></SOAP:Envelope>";
 }


I have read about operations that take no parameters having issues when using "wrapped" document/literal style. Is this the problem? I have tried so many different permutations of WSDL, java code, etc. that I am out of ideas.

Any suggestions or pointers would be appreciated. This seems to be a somewhat common issue on this forum but none of the other examples seem to be the cause here and this one involves an empty "wrapped" operation.

  • 1. Re:
    Christopher Stokes Newbie

    Moved to jbossws version 2.0 GA and now I get this error when I deploy the war:

    22:03:04,567 INFO [LifecycleHandlerImpl] WebService stopped: http://127.0.0.1:8
    080/xmlapi/invoke
    22:03:04,567 INFO [BasicEndpointRegistry] remove: jboss.ws:context=xmlapi,endpo
    int=find
    22:03:04,797 WARN [PolicyMetaDataBuilder] Cannot get service '{xmlapi_1.0}FindI
    mplService' from the given wsdl definitions! Eventual policies attached to this
     service won't be considered.
    22:03:05,027 INFO [TomcatDeployer] deploy, ctxPath=/xmlapi, warUrl=.../tmp/depl
    oy/tmp27747xmlapi-exp.war/
    22:03:05,157 INFO [WSDLFilePublisher] WSDL published to: file:/C:/cygwin/home/S
    tokeC/jboss-4.2.0.GA/server/default/data/wsdl/xmlapi.war/XmlApiMethods.wsdl
    22:03:05,177 INFO [BasicEndpointRegistry] register: jboss.ws:context=xmlapi,end
    point=find
    22:03:05,177 INFO [LifecycleHandlerImpl] WebService started: http://127.0.0.1:8
    080/xmlapi/invoke
    


    The find method still works, while the ping method still returns the error:
    22:14:58,563 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
    javax.xml.rpc.soap.SOAPFaultException: Endpoint {xmlapi_1.0}FindInterfacePort do
    es not contain operation meta data for: {xmlapi_1.0}ping
    


  • 2. Re:
    Christopher Stokes Newbie

    Considering a possible bug? in the raw soap generation I moved onto using a client created from wsconsume. Same error so this is maybe a WSDL issue... but the WSDL looks correct and the files are generated from the WSDL so now I'm really confused. A possible deployment problem?

    Simple client:

    package webservice;
    
    import java.net.MalformedURLException;
    import java.net.URL;
    
    import javax.xml.namespace.QName;
    import javax.xml.ws.Service;
    
    public class FindClient {
    
     public static void main(String[] args) throws MalformedURLException {
     Service service = Service.create(new URL("http://127.0.0.1:8080/xmlapi/invoke?wsdl"),
     new QName("xmlapi_1.0", "XmlApiMethods"));
    
     FindInterface find = service.getPort(FindInterface.class);
    
     find.ping();
     }
    
    }
    


    The error generated:
    Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Endpoint {xmlapi_1.0}FindInterfacePort does not contain operation meta data for: {xmlapi_1.0}ping
     at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:69)
     at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:109)
     at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:553)
     at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:371)
     at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
     at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
     at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
     at $Proxy15.ping(Unknown Source)
     at webservice.FindClient.main(FindClient.java:17)
    


  • 3. Re:
    Alessio Soldano Newbie

     

    "chris05atm" wrote:
    22:03:04,797 WARN [PolicyMetaDataBuilder] Cannot get service '{xmlapi_1.0}FindImplService' from the given wsdl definitions! Eventual policies attached to this service won't be considered.
    


    This is actually a warning; it says that the policy deployer was not able to get '{xmlapi_1.0}FindImplService' from the given wsdl definition, i.e. most probably the provided wsdl file doesn't match with the service metadata obtained from the annotated classes. For this reason eventual policies (cfr. WS-PolicyAttachment specs) won't be considered. But I think you don't care this, at least at the moment, since you have no attached policies.

    "chris05atm" wrote:
    Considering a possible bug? in the raw soap generation I moved onto using a client created from wsconsume. Same error so this is maybe a WSDL issue... but the WSDL looks correct and the files are generated from the WSDL so now I'm really confused. A possible deployment problem?


    Do you mean the annotated server classes were generated starting from wsconsume, i.e. using a top-down development strategy http://jbws.dyndns.org/mediawiki/index.php?title=JAX-WS_User_Guide#Top-Down_.28Using_wsconsume.29 ? If not, I would try this...
    Bye
    Alessio Soldano
    http://www.javalinux.it

  • 4. Re:
    Christopher Stokes Newbie

    The classes were generated by the wsconsume tool. The warning isn't the concern so much as the Endpoint error that occurs when the ping command is actually called.

  • 5. Re:
    Christopher Stokes Newbie

    To be more specific: the server service classes were also generated by wsconsume tool.

  • 6. Re: I am thinking there is some kind of deployment bug...
    Christopher Stokes Newbie

    I completely removed the jboss installation and reinstalled. Took the exact same ant file with the exact same sources and deployed in the exact same way.

    Everything works. I believe there is a clean up issue in the jbossws 2.0 or something. I suspected this when I finally started trying to just deploy a standard servlet with the same war file name. Jboss spit out errors about the old WebService which I knew to be impossible given the files I had deployed. Something was being cached somewhere incorrectly.

    On reinstall everything worked fine.

  • 7. Re:
    luis alejandro Newbie

    You are lucky man, I continue with the same error and I reinstalled all again and nothing. "Endpoint does not contain operation metadata" exception.

    :(. greetz. Luis.

  • 8. Re:
    Larry Anderson Newbie

    Has anyone found a solution to this? I am experiencing the same problem. Considering storing the posted WSDL from the webservice and using it to compile my client.

  • 9. Re:
    Christopher Stokes Newbie

    I guess the problem is that a this is a totally valid error if the wsdl and message are incorrect. In my case I believe it was a Jboss issue just because it worked when I reinstalled with the same files...

    Hard to say without more information from you guys.

  • 10. Re:
    Thomas Diesler Master

    Are you saying you have a wsdl that you feed into wsconsume. Then you implement an endpoint based on the generated SEI and it cannot be called.

    If that's the case, please create a JIRA issue and attach the wsdl to it. The issue should be linked to this forum thread

  • 11. Re:
    Christopher Stokes Newbie

    In the end it appeared to be something unrelated to either the wsdl, or generated java code.

    After a clean install of JBoss the same war file worked just fine. I believe there was some kind of cache/cleanup/whatever issue that prevented things from working properly. The order of events can be followed when viewing the entirety of the thread.

    I tried to isolate the differences but could not easily. No further deployments have caused issues or resulted in similar problems.