[Axis2] RuntimeException when using SOAPMonitor

2008-01-10 Thread home . andi
Hi Axis2 users,

i have implemented a very simple Axis2 webservice (request-response), which 
works correct as long as i don't use SOAPMonitor.

When I integrate SOAPMonitor into my Axis2 web-application, i get the following 
RuntimeException (mapped to an axis2fault) at the webservice response:
java.lang.RuntimeException: Element namespace from data source is 
http://my.company.com, not the expected

I assume i configured SOAPMonitor correct. I can use the SOAPMonitor applet, it 
shows the correct request message and the above-named fault-message. 
SOAPMonitor also works fine for me with one-way webservices.

So why do i get an error at the response when using SOAPMonitor?
Has anyone an idea or a similar problem?

Version:
Axis2-1.3
SOAPMonitor applet classes taken from Axis2-1.3/lib/soapmonitor-1.3.jar

The RuntimeException stacktrace is attached.

Thanks in advance,
Andi


Stacktrace (part of):
java.lang.RuntimeException: Element namespace from data source is 
http://my.company.com, not the expected
at 
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.forceExpand(OMSourcedElementImpl.java:184)
at 
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:568)
at 
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:772)
at 
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:756)
at 
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:210)
at 
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:756)
at 
org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:345)
at 
org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:913)
at 
org.apache.axis2.handlers.soapmonitor.SOAPMonitorHandler.invoke(SOAPMonitorHandler.java:101)
at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:377)
at 
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at 
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Axis2] wsdl2java code generation errors with jaxb and soap header

2007-06-14 Thread home . andi
Hello,

I generate client code out of a wsdl with axis2 (v. 1.2) wsdl2java and 
jaxbri(v. 2.0.2) databinding.
the wsdl not only defines request and reply messages but also the header 
element of the soap message.

i have the following problems with the generated code:
1) The generated code for the client stub doesn't compile because of a 
parameter error in the toOM-Method for the Header.
2) When i fix the error, the invocation of toOM fails because of incorrect/ 
missing values when creating the OMElement for the Header
3) When i fix this error too by filling in the correct values for the 
HeaderType, the client code works. 

I think the wsdl is correct because generated code with adb binding out of this 
wsdl works fine.

It seems that axis2 code generation doesn't generate correct code with jaxb 
binding when you have defined a soap header in the wsdl. 
Does someone have a similiar problem (or fixed it)?

greetings from sunny munich :)
andi

some code snippets from the generated stub:

toOM-Method call. mMS150_Display0 represents the request data type, mws1 
the header data type.
1)--
**snip**
env = toEnvelope(getFactory(
_operationClient.getOptions().getSoapVersionURI()), 
mMS150_Display0, 
optimizeContent(new javax.xml.namespace.QName(, MMS150_Display)));
env.build();
// add the children only if the parameter is not null
if (mws1!=null){
env.getHeader().addChild(
toOM(mws1, optimizeContent(new javax.xml.namespace.QName(, 
MMS150_Display;
}
**snap**

toOM-Method for the header:
2)--
**snip**
private org.apache.axiom.om.OMElement toOM(net.company.mws.mws2.HeaderType 
param, org.apache.axiom.soap.SOAPFactory factory, boolean optimizeContent) {
try {
javax.xml.bind.JAXBContext context = net_company_mws_mws2_HeaderType;
javax.xml.bind.Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FRAGMENT, 
Boolean.TRUE);

JaxbRIDataSource source = new JaxbRIDataSource( 
net.company.mws.mws2.HeaderType.class,
param,
marshaller,
,
);
org.apache.axiom.om.OMNamespace namespace = 
factory.createOMNamespace(,
   null);
return factory.createOMElement(source, , namespace);
} catch (javax.xml.bind.JAXBException bex){
throw new RuntimeException(bex);
}
}

**snap**

the call of the toOM-Method (with Parameters HeaderType, boolean) doesn't fit 
with the signature of the toOm-Method (HeaderType, SOAPFactory, boolean)
i can correct this error by adding 
getFactory(_operationClient.getOptions().getSoapVersionURI()) to the 
toOM-Method call in the generated stub.
then i run into the second error i mentioned above. 

The following code snippet shows the correct values for in the toOM-Method:
3)--
**snip**
JaxbRIDataSource source = new JaxbRIDataSource( 
net.company.mws.mws2.HeaderType.class,
param,
marshaller,
http://mws.company.net/mws2;,
mws);
org.apache.axiom.om.OMNamespace namespace = factory.createOMNamespace(,
   null);
return factory.createOMElement(source, mws, namespace);
**snap**

the wsdl:
--
**snip**
?xml version=1.0 encoding=UTF-8?
wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; 
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; 
xmlns:mws=http://mws.company.net/mws2; 
xmlns:tns=http://schemas.company.com/KKTEST2; 

xmlns:mms150_display=http://schemas.company.com/KKTEST2/MMS150_Display; 
name=KKTEST2 targetNamespace=http://schemas.company.com/KKTEST2;
  wsdl:types
xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
targetNamespace=http://schemas.company.com/KKTEST2/MMS150_Display; 
elementFormDefault=qualified
  xsd:element name=MMS150_Display 
type=mms150_display:MMS150_DisplayType /
  xsd:complexType name=MMS150_DisplayType
xsd:sequence
  xsd:element name=MMS150 type=mms150_display:ct_0 /
/xsd:sequence
  /xsd:complexType
  xsd:complexType name=ct_0
xsd:sequence
  xsd:element name=User nillable=true maxOccurs=1 minOccurs=0
xsd:simpleType
  xsd:restriction base=xsd:string
xsd:maxLength value=10 /
  /xsd:restriction
/xsd:simpleType
  /xsd:element
/xsd:sequence