You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "florian pitschi (JIRA)" <ax...@ws.apache.org> on 2005/07/14 09:41:14 UTC

[jira] Created: (AXIS-2117) RPC-Literal encoding not supported?

RPC-Literal encoding not supported?
-----------------------------------

         Key: AXIS-2117
         URL: http://issues.apache.org/jira/browse/AXIS-2117
     Project: Apache Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.2    
    Reporter: florian pitschi


When I try to send rpc/literal messages, Arrays of simple type (in Beans) and Arrays of complex types are sent rpc/encoded. Simple attributes in beans are encoded correctly. Is this a bug or am I not using the call-obj correctly (see client code below)?

For example: I have a Bean called SimpleInfo, containing a String stringProperty, an int intProperty and and String[] stringArrayProperty. The ws-method ObjnachString takes a SimpleInfo and converts it into a string. The SOAP-Request created by the client (using axis 1.2) is:


<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ObjnachString xmlns="http://db.bioinfo.rzg.mpg.de">
   <SimpleInfo_1 xmlns="">
    <intProperty>777</intProperty>
    <stringArrayProperty soapenc:arrayType="xsd:string[3]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
     <item>25</item>
     <item>42</item>
     <item>usw</item>
    </stringArrayProperty>
    <stringProperty>janein</stringProperty>
   </SimpleInfo_1>
  </ObjnachString>
 </soapenv:Body>
</soapenv:Envelope>


So the stringArrayProperty is encoded instead of literal! My client code is:

// ... (create serviceobj) ...
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping typemappingLIT = registry.getTypeMapping("");
	       
typemappingLIT.register(SimpleInfo.class,
	             		       simpleinfoQNAME,
	        		       new BeanSerializerFactory(SimpleInfo.class, simpleinfoQNAME),
				       new BeanDeserializerFactory(SimpleInfo.class, simpleinfoQNAME));

QName operation = new QName("ObjnachString");
        Call call = service.createCall(port, operation);
   
        call.setProperty(Call.SOAPACTION_USE_PROPERTY,
        new Boolean(true));
        call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
        call.setProperty(ENCODING_STYLE_PROPERTY, ""); // literal!
        call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
        call.setTargetEndpointAddress("http://localhost:7000/seqref/seqref/SeqReferenceInfo");

        SimpleInfo request = new SimpleInfo();
        request.setStringArrayProperty(new String[] {"25","42","usw"});
        request.setIntProperty(777);
        request.setStringProperty("janein");
                
        Object[] params = {request};

        String response = (String) call.invoke(params);




Thanks for your help.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS-2117) RPC-Literal encoding not supported?

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2117?page=all ]
     
Davanum Srinivas resolved AXIS-2117:
------------------------------------

    Resolution: Fixed

please generate code using wsdl2java and compare the code with your handwritten code. 

-- dims

> RPC-Literal encoding not supported?
> -----------------------------------
>
>          Key: AXIS-2117
>          URL: http://issues.apache.org/jira/browse/AXIS-2117
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2
>     Reporter: florian pitschi

>
> When I try to send rpc/literal messages, Arrays of simple type (in Beans) and Arrays of complex types are sent rpc/encoded. Simple attributes in beans are encoded correctly. Is this a bug or am I not using the call-obj correctly (see client code below)?
> For example: I have a Bean called SimpleInfo, containing a String stringProperty, an int intProperty and and String[] stringArrayProperty. The ws-method ObjnachString takes a SimpleInfo and converts it into a string. The SOAP-Request created by the client (using axis 1.2) is:
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>  <soapenv:Body>
>   <ObjnachString xmlns="http://db.bioinfo.rzg.mpg.de">
>    <SimpleInfo_1 xmlns="">
>     <intProperty>777</intProperty>
>     <stringArrayProperty soapenc:arrayType="xsd:string[3]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>      <item>25</item>
>      <item>42</item>
>      <item>usw</item>
>     </stringArrayProperty>
>     <stringProperty>janein</stringProperty>
>    </SimpleInfo_1>
>   </ObjnachString>
>  </soapenv:Body>
> </soapenv:Envelope>
> So the stringArrayProperty is encoded instead of literal! My client code is:
> // ... (create serviceobj) ...
> TypeMappingRegistry registry = service.getTypeMappingRegistry();
> TypeMapping typemappingLIT = registry.getTypeMapping("");
> 	       
> typemappingLIT.register(SimpleInfo.class,
> 	             		       simpleinfoQNAME,
> 	        		       new BeanSerializerFactory(SimpleInfo.class, simpleinfoQNAME),
> 				       new BeanDeserializerFactory(SimpleInfo.class, simpleinfoQNAME));
> QName operation = new QName("ObjnachString");
>         Call call = service.createCall(port, operation);
>    
>         call.setProperty(Call.SOAPACTION_USE_PROPERTY,
>         new Boolean(true));
>         call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
>         call.setProperty(ENCODING_STYLE_PROPERTY, ""); // literal!
>         call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
>         call.setTargetEndpointAddress("http://localhost:7000/seqref/seqref/SeqReferenceInfo");
>         SimpleInfo request = new SimpleInfo();
>         request.setStringArrayProperty(new String[] {"25","42","usw"});
>         request.setIntProperty(777);
>         request.setStringProperty("janein");
>                 
>         Object[] params = {request};
>         String response = (String) call.invoke(params);
> Thanks for your help.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2117) RPC-Literal encoding not supported?

Posted by "florian pitschi (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2117?page=comments#action_12315900 ] 

florian pitschi commented on AXIS-2117:
---------------------------------------

I used wsdl2java, and think a static stub class is created.
public class SeqReferenceInfoEndpointBindingStub extends org.apache.axis.client.Stub

Unfortunately, I am trying to use a DII-Client.
Nevertheless, I read the code and found out that a lot of properties are set using a Call object (_call).

In the method createCall(), the _call object is created with

org.apache.axis.client.Call _call = super._createCall();

So this code can't be used for a DII client - can it? (because super.(x) will call the constructor from org.apache.axis.client.Stub... :-( ) ?

The invocations of the operations are all made using this object, s.th. like

     org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://db.bioinfo.rzg.mpg.de", "ObjArrToStr"));

        setRequestHeaders(_call);
        setAttachments(_call);
 try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] ...




Can you tell me how to get the DII client running - perhaps there is a tutorial somewhere (how to create the servicefactory, service and call object and how to set the properties correctly)? I am more familiar with the javax.xml.rpc.* ... perhaps there is a easier solution with these classes? 



> RPC-Literal encoding not supported?
> -----------------------------------
>
>          Key: AXIS-2117
>          URL: http://issues.apache.org/jira/browse/AXIS-2117
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2
>     Reporter: florian pitschi

>
> When I try to send rpc/literal messages, Arrays of simple type (in Beans) and Arrays of complex types are sent rpc/encoded. Simple attributes in beans are encoded correctly. Is this a bug or am I not using the call-obj correctly (see client code below)?
> For example: I have a Bean called SimpleInfo, containing a String stringProperty, an int intProperty and and String[] stringArrayProperty. The ws-method ObjnachString takes a SimpleInfo and converts it into a string. The SOAP-Request created by the client (using axis 1.2) is:
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>  <soapenv:Body>
>   <ObjnachString xmlns="http://db.bioinfo.rzg.mpg.de">
>    <SimpleInfo_1 xmlns="">
>     <intProperty>777</intProperty>
>     <stringArrayProperty soapenc:arrayType="xsd:string[3]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>      <item>25</item>
>      <item>42</item>
>      <item>usw</item>
>     </stringArrayProperty>
>     <stringProperty>janein</stringProperty>
>    </SimpleInfo_1>
>   </ObjnachString>
>  </soapenv:Body>
> </soapenv:Envelope>
> So the stringArrayProperty is encoded instead of literal! My client code is:
> // ... (create serviceobj) ...
> TypeMappingRegistry registry = service.getTypeMappingRegistry();
> TypeMapping typemappingLIT = registry.getTypeMapping("");
> 	       
> typemappingLIT.register(SimpleInfo.class,
> 	             		       simpleinfoQNAME,
> 	        		       new BeanSerializerFactory(SimpleInfo.class, simpleinfoQNAME),
> 				       new BeanDeserializerFactory(SimpleInfo.class, simpleinfoQNAME));
> QName operation = new QName("ObjnachString");
>         Call call = service.createCall(port, operation);
>    
>         call.setProperty(Call.SOAPACTION_USE_PROPERTY,
>         new Boolean(true));
>         call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
>         call.setProperty(ENCODING_STYLE_PROPERTY, ""); // literal!
>         call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
>         call.setTargetEndpointAddress("http://localhost:7000/seqref/seqref/SeqReferenceInfo");
>         SimpleInfo request = new SimpleInfo();
>         request.setStringArrayProperty(new String[] {"25","42","usw"});
>         request.setIntProperty(777);
>         request.setStringProperty("janein");
>                 
>         Object[] params = {request};
>         String response = (String) call.invoke(params);
> Thanks for your help.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira