"Endpoint does not contain operation metadata" exception
chris05atm Jul 10, 2007 7:02 PMHello 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.