Hmm... I see a possible bug of the XMLSchema library here. The schemas are kept as XMLschema objects inside the AxisService and what happens in the XMLBeans databinding is that the schema object is serialized and fed into the XMLBeans schema compiler. XMLSchema serilialization may have a problem and the mentioned namespace prefix may be generated by XMLSchema
Ajith On 5/13/06, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
Ken, Could u please log a JIRA bug and then upload your WSDL? thanks, dims On 5/12/06, Ken Campbell <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry to bang on about this but I tried removing the targetNamespace > entirely from my wsdl and then re-ran WSDL2Java to see if the namespace > declarations in the soap:body of the message could be removed. > > So now I am asking why WSDL2Java throws: > Invalid QName value: Can't resolve prefix 'gen361' ? > I don't have a 'gen361' prefix in my schema. > > Regards, > Ken > > <WSDL2Java exception follows :> > > > >WSDL2Java -uri ..\DEVELOP\paf\PAF.wsdl -ss -sd -g -d xmlbeans -o > ..\DEVELOP\paf -p edp.ws.paf.generated > Using AXIS2_HOME: C:\Apache\Tomcat5\webapps\axis2\WEB-INF > Using JAVA_HOME: C:\Program Files\Java\jdk1.5.0_04 > org.apache.axis2.wsdl.codegen.CodeGenerationException > : java.lang.RuntimeException: java.lang.reflect.InvocationTargetException > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener > ationEngine.java:185) > at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32) > at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21) > Caused by: java.lang.RuntimeException: > java.lang.reflect.InvocationTargetExcepti > on > at > org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLB > eansExtension.java:93) > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener > ationEngine.java:140) > ... 2 more > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLB > eansExtension.java:83) > ... 3 more > Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: > error: > Invalid QName value: Can't resolve prefix 'gen361' > at > org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGe > nerationUtility.java:192) > ... 8 more > Caused by: org.apache.xmlbeans.XmlException: error: Invalid QName value: > Can't r > esolve prefix 'gen361' > at > org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(Sche > maTypeSystemCompiler.java:225) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:665) > at > org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGe > nerationUtility.java:161) > ... 8 more > > ________________________________________ > From: Ken Campbell [mailto:[EMAIL PROTECTED] > Sent: 12 May 2006 15:10 > To: [email protected] > Subject: RE: [Axis2 1.0] MessageContext question > > Hi, > > Further to my question, the data binding error is thrown by > org.apache.xmlbeans.SchemaTypeLoader.parse(XmlStreamReader, SchemaType, > XmlOptions) in one of my bound classes (LoginRequestDocument). However, with > the msgContext.getEnvelope() line placed in the code shown below it manages > to generate a LoginRequestDocument and a LoginResponseDocument (both of > which make sense) before the exception is thrown!? Surely there either is a > data binding error or there is not. How can it have it both ways? Here is > the SOAP envelope for the request: > > <?xml version='1.0' encoding='utf-8'?> > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > <soapenv:Header /> > <soapenv:Body> > <LoginRequest xmlns="paf.ws.edp.co.uk"> > <env>default</env> > <userID>test</userID> > <password>test</password> > </LoginRequest> > </soapenv:Body> > </soapenv:Envelope> > > Regards, > Ken > > ________________________________________ > From: Ken Campbell [mailto:[EMAIL PROTECTED] > Sent: 12 May 2006 11:07 > To: [email protected] > Subject: [Axis2 1.0] MessageContext question > > Hi, > > If someone understands the AxisEngine well I'd appreciate them having a look > at this problem: > > I'm having a data binding error which I don't understand. In an attempt to > trace it I've called: > System.out.println(msgContext.getEnvelope()); > in MyMessageReceiverInOut.invokeBusinessLogic() > > This seems to have a very weird effect. By placing it here : > > … > if("login".equals(methodName)){ > > > uk.co.edp.ws.paf.LoginResponseDocument param11 = null; > System.out.println(msgContext.getEnvelope()); > > //doc style > param11 =skel.login( > (uk.co.edp.ws.paf.LoginRequestDocument)fromOM( > > msgContext.getEnvelope().getBody().getFirstElement(), > uk.co.edp.ws.paf.LoginRequestDocument.class, > > getEnvelopeNamespaces(msgContext.getEnvelope()))); > > envelope = toEnvelope(getSOAPFactory(msgContext), param11, > false); > System.out.println("toEnvelope() returned."); > … > > > the service classes will return a valid param11, but axis throws an > exception: > > - Servlet.service() for servlet AxisServlet threw exception > java.lang.NullPointerException > at > com.ctc.wstx.util.BijectiveNsMap.findPrefixByUri(BijectiveNsMap.java:132) > at > com.ctc.wstx.sw.SimpleOutputElement.getPrefix(SimpleOutputElement.java:453) > at > org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeAttributes > (StreamingOMSerializer.java:214) > at > org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeElement(St > reamingOMSerializer.java:147) > at > org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeNode(Strea > mingOMSerializer.java:73) > at > org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serialize(Streaming > OMSerializer.java:56) > at > org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStream(OMSeria > lizerUtil.java:315) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl. > java:786) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMEl > ementImpl.java:809) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl. > java:780) > at > org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvel > opeImpl.java:171) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMEl > ementImpl.java:809) > at > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java > :381) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputSt > ream(CommonsHTTPTransportSender.java:256) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTT > PTransportSender.java:210) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589) > at > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstract > InOutSyncMessageReceiver.java:43) > at > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454)….. > - Servlet.service() for servlet jsp threw exception > java.lang.IllegalStateException: getOutputStream() has already been called > for this response…. > > So my question is, it seems as if MessageContext.getEnvelope() in some way > 'consumes' the data stream. How is it possible > that I am getting a response from my service classes when I do this and that > no other class complains about my intercepting msgContext until > BijectiveNsMap ? The data binding error is normally thrown in > MyMessageReceiverInOut.fromOM() at the request but when I call > msgContext.getEnvelope() > it happily goes off and gets a proper response! > > Regards, > Ken > > > -- Davanum Srinivas : http://wso2.com/blogs/
-- Ajith Ranabahu
