• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SOAP Fault Exception - does not contain operation meta data for

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to write a simple web service. I am using JBoss 4.2.2 and have implemented a simple stateless session bean that acts as my web service. The method call is getAllMetaData (sorry if its confusing but my application involves meta data which should have nothing to do with the error I am seeing) and it returns a long String. I have seen others on this message board (under JBoss and Web Service topic) have this error, but no one answered the topic. Plus, most examples have servlet endpoints, but mine is an EJB endpoint, if that matters much.

Before my client tries to use the web service, I print out the SOAP message it is sending using the writeTo() method. Below is what it is printing, I assume that this is where the problem is, that my outgoing SOAP request message is missing something:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body><m:getAllMetaData xmlns:m="http://alex.com"/></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The client code snippet that generates this message is this:

SOAPConnectionFactory soapConnectionFactory =
SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();

MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();

SOAPHeader header = message.getSOAPHeader();
SOAPBody body = message.getSOAPBody();
header.detachNode();

Name bodyName = soapFactory.createName( "getAllMetaData",
"m",
"http://alex.com" );
SOAPBodyElement bodyElement = body.addBodyElement( bodyName );

message.writeTo( System.out );

URL endpoint = new URL( "http://localhost:8080/AlexTry-alexws-ejb/WebServiceBean?wsdl" );
SOAPMessage response = connection.call( message, endpoint );

connection.close();
}
catch ( Exception ex )
{
ex.printStackTrace();
}

And here is my WSDL file, which I generated using the wscompile tool from J2EE:

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

<definitions name="AlexWebService" targetNamespace="http://alex.com/" xmlns:tns="http://alex.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types/>
<message name="WebServiceEndpoint_getAllMetaData"/>
<message name="WebServiceEndpoint_getAllMetaDataResponse">
<part name="result" type="xsd:string"/></message>
<portType name="WebServiceEndpoint">
<operation name="getAllMetaData">
<input message="tns:WebServiceEndpoint_getAllMetaData"/>
<output message="tns:WebServiceEndpoint_getAllMetaDataResponse"/></operation></portType>
<binding name="WebServiceEndpointBinding" type="tns:WebServiceEndpoint">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="getAllMetaData">
<soap peration soapAction=""/>
<input>
<soap:body use="literal" namespace="http://alex.com/"/></input>
<output>
<soap:body use="literal" namespace="http://alex.com/"/></output></operation></binding>
<service name="AlexWebService">
<port name="WebServiceEndpointPort" binding="tns:WebServiceEndpointBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>

And here is the full exception I am getting:

11:05:48,203 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://alex.com/}WebServiceEndpointPort does not contain operation meta data for: {http://alex.com}getAllMetaData
at org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC.exceptionToFaultMessage(SOAPFaultHelperJAXRPC.java:189)
at org.jboss.ws.core.jaxrpc.SOAP11BindingJAXRPC.createFaultMessageFromException(SOAP11BindingJAXRPC.java:63)
at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBinding.java:645)
at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:277)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)

Any help really appreciated!
Thanks,
Alex
[ June 16, 2008: Message edited by: Alex Mbatra ]
 
Alex Mbatra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I figured this out on my own. Since I couldn't find any solutions online about this, I will put the fix here. I should say that the error output and stack trace from JBoss and/or J2EE for this error is pretty cryptic.

The problem I had was in my config.xml which I used as input to my wscompile tool that comes with J2EE. The wscompile tool generates my wsdl and mapping.xml files. The config.xml had a "targetNamespace" of http://alex.com/. And my web service client built the soap message like this:

Name bodyName = soapFactory.createName( "getAllMetaDataStr",
// don't know how 2nd arg is used yet
"blah",
"http://alex.com" );

So the slash "/" at the end is what the problem was!!! So moral of the story is the "targetNamespace" for your wsdl and mapping.xml files must be exactly the same as the 3rd argument to the soap factory createName() method.

-Alex
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic