Thomas,
if the neither wsdl nor jaxrpc-mapping.xml are availible then there are no 
other option than to use DII. It sucks but that's the case sometimes..

However, I still can't find from the users guide how to do when the web service 
return a complex type.

My code now looks like this:


  |                     String endpoint = 
"https://cbg.tele2.com:443/xmlrpc-login";;
  |                     
  |                     ServiceFactory factory = ServiceFactory.newInstance();
  |                     Service service = factory.createService(new 
QName("ANY_SERVICE_NAME"));
  |                     Call call = service.createCall();
  |                     call.setTargetEndpointAddress(endpoint);
  |                     call.setOperationName(new QName("http://testuri.org";, 
"TRANSLATEIP"));
  |                     call.addParameter("login.user", 
Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
  |                     call.addParameter("login.password", 
Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
  |                     call.addParameter("OriginatingCustomerIP", 
Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
  |                     
  |                     QName qn = new QName( "item" );
  |                     call.setReturnType(qn,Item.class);
  |             Item ret = (Item) call.invoke( new Object[] { user, password, 
ip});
  | 

This cause a stack trace like this:
java.lang.IllegalArgumentException: Invalid namespace for type: item
        at 
org.jboss.ws.jaxrpc.SchemaGenerator.assertXmlType(SchemaGenerator.java:104)
        at 
org.jboss.ws.jaxrpc.SchemaGenerator.generateXSDSchema(SchemaGenerator.java:55)
        at 
org.jboss.ws.jaxrpc.CallImpl.generateOrUpdateParameterSchema(CallImpl.java:804)
        at 
org.jboss.ws.jaxrpc.CallImpl.generateOrUpdateSchemas(CallImpl.java:783)Got 
MSISDN null

        at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:623)
        at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:398)

>From the doc of this api:
anonymous wrote : 
  | An example request:
  | 
  | <?xml version="1.0" encoding="ISO-8859-1"?>
  | <SOAP-ENV:Envelope 
  | SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";  
  | xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
  | xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";  
  | xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";  
xmlns:si="http://soapinterop.org/xsd";>
  | <SOAP-ENV:Body>
  | <ns1:TRANSLATEIP xmlns:ns1="http://testuri.org";>
  |  <login.user xsi:type="xsd:string">K123456</login.user>
  |  <login.password xsi:type="xsd:string">XXXXX</login.password>
  |  <OriginatingCustomerIP xsi:type="xsd:string">129.23.23.2
  | </ns1:TRANSLATEIP>
  | </SOAP-ENV:Body>
  | </SOAP-ENV:Envelope>
  | 
  | An example response looks the following way:
  | 
  | <?xml version="1.0"?>
  | <SOAP-ENV:Envelope 
  | xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
  | xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
  | xmlns:xsd="http://www.w3.org/1999/XMLSchema"; 
  | xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
  | xmlns:si="http://soapinterop.org/xsd"; xmlns:ns6="http://testuri.org"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
  | <SOAP-ENV:Body>
  |  
  |   
  |    <OriginatingCustomerId xsi:type="xsd:string">46736123123
  |   
  |  
  | </SOAP-ENV:Body>
  | </SOAP-ENV:Envelope>
  | 

I was able to implement this with Axis by doing like this:

  |                     QName qn = new QName( XMLConstants.NULL_NS_URI, "item" 
);
  |             call.registerTypeMapping(Item.class, qn,
  |                           new 
org.apache.axis.encoding.ser.BeanSerializerFactory(Item.class, qn),        
  |                           new 
org.apache.axis.encoding.ser.BeanDeserializerFactory(Item.class, qn));
  |             call.setReturnType(qn);
  | 
plus that the Item class contains a type description like this:

  |     //       Type metadata
  |     private static TypeDesc typeDesc = new TypeDesc(Item.class, true);
  | 
  |     static {
  |             typeDesc.setXmlType(new QName(XMLConstants.NULL_NS_URI, 
"item"));
  |             ElementDesc elemField = new ElementDesc();
  |             elemField.setFieldName("error");
  |             elemField.setXmlName(new javax.xml.namespace.QName("", 
"Error"));
  |             elemField.setXmlType(new 
javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/";, 
"string"));
  |             elemField.setNillable(true);
  |             
  |             typeDesc.addFieldDesc(elemField);
  |             elemField = new org.apache.axis.description.ElementDesc();
  |             elemField.setFieldName("originatingCustomerId");
  |             elemField.setXmlName(new javax.xml.namespace.QName("", 
"OriginatingCustomerId"));
  |             elemField.setXmlType(new 
javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/";, 
"string"));
  |             elemField.setNillable(true);
  |             typeDesc.addFieldDesc(elemField);
  | 
  |             elemField = new org.apache.axis.description.ElementDesc();
  |             elemField.setFieldName("transactionId");
  |             elemField.setXmlName(new javax.xml.namespace.QName("", 
"TransactionId"));
  |             elemField.setXmlType(new 
javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/";, 
"string"));
  |             elemField.setNillable(true);
  |             typeDesc.addFieldDesc(elemField);
  | 
  |             elemField = new org.apache.axis.description.ElementDesc();
  |             elemField.setFieldName("status");
  |             elemField.setXmlName(new javax.xml.namespace.QName("", 
"Status"));
  |             elemField.setXmlType(new 
javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/";, "int"));
  |             elemField.setNillable(true);
  |             typeDesc.addFieldDesc(elemField);
  |     }
  | 

How to accomplish the same with jbossws?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3952078#3952078

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3952078


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to