[mule-user] Issue wen trying to use CXF client (WS consumer mode)

7 views
Skip to first unread message

jmlqc

unread,
Jun 11, 2011, 2:50:14 AM6/11/11
to us...@mule.codehaus.org
Hello,

I'm trying to call this online Web Service : http://www.thomas-bayer.com/soap/csv-xml-converter-webservice.htm
which required up to 4 parameters.
I'm not able to make the CXF work, I have the following error :

ERROR 2011-06-08 23:17:33,969 [http://Central].flow.bf767888-1827-4ea2-83f1-b45618716460.1 org.mule.exception.DefaultServiceExceptionStrategy:
********************************************************************************
Message : wrong number of arguments (java.lang.IllegalArgumentException)
Code : MULE_ERROR-10999
Exception stack is:
1. wrong number of arguments (java.lang.IllegalArgumentException)
sun.reflect.NativeMethodAccessorImpl:-2 (null)
2. wrong number of arguments (java.lang.IllegalArgumentException) (org.mule.api.DefaultMuleException)
org.mule.module.cxf.CxfOutboundMessageProcessor:141 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/DefaultMuleException.html)
Root Exception stack trace:
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Even if I'm sending to CXF an Object[].
Here my mule config :
<flow name="bf767888-1827-4ea2-83f1-b45618716460">
...
<processor-chain>
<custom-transformer class="interop.transformer.WebService" doc:name="ConfigureObject[]" doc:description="Transformer that delegates to a Java class."/>
<logger level="INFO" doc:name="Logger" doc:description="Performs logging using an expression that determines what should be logged."/>
<cxf:jaxws-client clientClass="CSV2XML.CSV2XMLService" port="CSV2XMLServiceSOAP11port_http" wsdlLocation="http://www.thomas-bayer.com/axis2/services/CSV2XMLService?wsdl" operation="convert" doc:name="SOAP" doc:description="Make a web service available via CXF"/>
<vm:outbound-endpoint path="result.queue" connector-ref="vmglobal" doc:name="VM" doc:description="Facilitates intra-VM component communication."/>
</processor-chain>
</flow>

and my transformer :

....

@Override
public Object[] transformMessage(MuleMessage message, String outputEncoding) throws TransformerException
{
Object objArray[] = new Object[4];
objArray[0] = ";";
objArray[1] = true;
objArray[2] = "";
objArray[3] = message.getPayload();
//System.out.println("PAYLOAD = " + objArray[3]);
return objArray;
}
....

Is there someone have the same issue or can someone tell me what's wrong with my config ?
Many thanks.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Tomas Blohm

unread,
Jun 13, 2011, 4:24:47 AM6/13/11
to us...@mule.codehaus.org
Hi,

what does your CSV2XMLService convert method look like?

/Tomas Blohm

jmlqc

unread,
Jun 13, 2011, 5:52:35 AM6/13/11
to us...@mule.codehaus.org
Hi Thomas,
Thanks for replying, here the convert method :

package CSV2XML;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;


/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="delimiter" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="firstLineAreColumnNames" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* &lt;element name="stringDelimiter" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="csvtext" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"delimiter",
"firstLineAreColumnNames",
"stringDelimiter",
"csvtext"
})
@XmlRootElement(name = "convert", namespace = "http://thomas-bayer.com/cx/")
public class Convert {

@XmlElement(namespace = "http://thomas-bayer.com/cx/")
protected String delimiter;
@XmlElement(namespace = "http://thomas-bayer.com/cx/")
protected Boolean firstLineAreColumnNames;
@XmlElement(namespace = "http://thomas-bayer.com/cx/")
protected String stringDelimiter;
@XmlElement(namespace = "http://thomas-bayer.com/cx/", required = true)
protected byte[] csvtext;

/**
* Gets the value of the delimiter property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDelimiter() {
return delimiter;
}

/**
* Sets the value of the delimiter property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDelimiter(String value) {
this.delimiter = value;
}

/**
* Gets the value of the firstLineAreColumnNames property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isFirstLineAreColumnNames() {
return firstLineAreColumnNames;
}

/**
* Sets the value of the firstLineAreColumnNames property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setFirstLineAreColumnNames(Boolean value) {
this.firstLineAreColumnNames = value;
}

/**
* Gets the value of the stringDelimiter property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStringDelimiter() {
return stringDelimiter;
}

/**
* Sets the value of the stringDelimiter property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStringDelimiter(String value) {
this.stringDelimiter = value;
}

/**
* Gets the value of the csvtext property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getCsvtext() {
return csvtext;
}

/**
* Sets the value of the csvtext property.
*
* @param value
* allowed object is
* byte[]
*/
public void setCsvtext(byte[] value) {
this.csvtext = ((byte[]) value);

jmlqc

unread,
Jun 15, 2011, 5:27:37 PM6/15/11
to us...@mule.codehaus.org
Is anyone can tell me if I'm doing something wrong ? Or is someone have an example of a WS consummed by CXF endpoint in a flow??

jmlqc

unread,
Jul 5, 2011, 4:26:36 PM7/5/11
to us...@mule.codehaus.org
Finally found what was wrong....

Sudeep Dhonde

unread,
Aug 8, 2011, 12:37:33 AM8/8/11
to us...@mule.codehaus.org
Hi,

Can you please share the same? Or the Guidelines.

Thanks,
Sudeep.

ruslan shvets

unread,
Aug 11, 2011, 5:11:06 AM8/11/11
to us...@mule.codehaus.org
Hi, jmlqc

Can you share what's the problem, please. I got the similar error using cxf:jaxws-client generated by wsimport on wsdl
-----
Message : argument type mismatch (java.lang.IllegalArgumentException)
Code : MULE_ERROR-10999
********************************************************************************
Exception stack is:
1. argument type mismatch (java.lang.IllegalArgumentException)
sun.reflect.NativeMethodAccessorImpl:-2 (null)
2. argument type mismatch (java.lang.IllegalArgumentException) (org.mule.api.DefaultMuleException)


org.mule.module.cxf.CxfOutboundMessageProcessor:141 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/D
efaultMuleException.html)

********************************************************************************
Root Exception stack trace:
java.lang.IllegalArgumentException: argument type mismatch


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

-----

here's my config:
<flow name="myFlow">
<file:inbound-endpoint path="\myPath">
<outbound-endpoint address="http://localhost:80/myWS/portal">
<cxf:jaxws-client clientClass="Portal" port="portalSoap" wsdlLocation="http://localhost:80/myWS/portal?wsdl" operation="sendlist">
</outbound-endpoint>
</flow>

the problem not in mule side?

Thanks in advance

jmlqc

unread,
Aug 11, 2011, 6:21:27 AM8/11/11
to us...@mule.codehaus.org
Hi Sudeep,

Sorry for my late answer, I don't have the source code now, but i will send you what I did tonight.

JM

jmlqc

unread,
Aug 11, 2011, 6:23:20 AM8/11/11
to us...@mule.codehaus.org
Hi ruslan,

Where is your transformer to format your object in the right way. You have to provide an object[] to the CXF client.

Jm

jmlqc

unread,
Aug 11, 2011, 5:38:41 PM8/11/11
to us...@mule.codehaus.org
Here the code I used :

public class FormatObject extends AbstractTransformer
{

public FormatObject()
{
registerSourceType(DataTypeFactory.STRING);
setReturnDataType(DataTypeFactory.create(Object[].class));
}

@Override
public Object doTransform(Object src, String outputEncoding) throws TransformerException
{

....

....

Object [] out = new Object[4];
out[0] = ";";
out[1] = false;
out[2] = "\"";
out[3] = Base64.encode(in);

return out;
}

Hope it will help u!

JM

lerpa

unread,
Aug 16, 2011, 8:54:02 PM8/16/11
to us...@mule.codehaus.org
Hi, jmlqc

Thanks for your reply

this my goal: get XLS parse it and send thru SOAP. mule3.1.1

I do generate proxy PortalService (wsimport), test it - it's works - send and take answer

then add in my config transformer that convert HSSF into SendList (WebParam)
--------
<spring:bean id="refHSSF2SendlistTransformer" class="HSSF2SendlistTransformer"/>
<flow name="cr2cpcFlow">
<file:inbound-endpoint transformer-refs="refHSSF2SendlistTransformer" path="./in"/>
h5. <!-- then I think it moves wrapped in MuleMessage to SendListClient -->
<cxf:jaxws-client clientClass="SendListClient" port="portalSoap" wsdlLocation="http://myserver/myapp/portal?wsdl" operation="sendlist"/>
</flow>
--------
public class SendListClient {
public SendListClient(Object[] context) {}
----> public SendListClient(URL target, QName qname) {}
h5. and this is my entrypoint, without this constructor my error looks: SendListClient<init>(URL, QName) (NoSuchMethodException)
}
-----
with this constructor I got:
org.mule.api.lifecycle.InitialisationException: Error creating bean with name 'cr2cpcFlow': Cannot create inner bean '(inner bean)' of type [org.mule.module.cxf.config.JaxWsClientFactoryBean] while setting bean property 'messageProcessors' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation; nested exception is org.mule.api.DefaultMuleException: null (java.lang.NullPointerException)

trying to extend SendListClient with AbstractConnector but still no effect
and what means this: while setting bean property 'messageProcessors' with key

maybe let the transformer send http request ))

Thanks a lot!

jmlqc

unread,
Aug 17, 2011, 7:38:22 AM8/17/11
to us...@mule.codehaus.org
hi lerpa,

I think that the client class that u are calling is not the right one (SendListClient).
When u import your wsdl, what are the class created?

lerpa

unread,
Aug 17, 2011, 5:00:24 PM8/17/11
to us...@mule.codehaus.org
Hi, jmlqc

public class Portal extends Service
public class ObjectFactory
public interface PortalPortType
{
@WebMethod(action = "http://localhost/ws#portal:sendlist")
public Arrayofstring sendlist(
@WebParam(name = "list", targetNamespace = "http://localhost/ws/portal"))
}
-----
and other classes that represent <complexContent>, <complexType>, <sequence> etc

hmmm.. wrong class...
I wrote class SendListClientTest to test my proxy class Portal and it's work (outside Mule)

-----
ObjectFactory of = new ObjectFactory();
Smslist list = of.createSmslist();

logger.info(list.toString());

Sms sms = of.createSms();
sms.setAddr("addr");
sms.setDate(date);
sms.setRecipient("recipient");
sms.setSender("sender");
sms.setValue("text");
list.getSms().add(sms);

PortalPortType port = service.getPortalSoap();
Arrayofstring res = port.sendlist(list);
-----
and I suggested that <cxf:jaxws:client> have be in that style
I use the transformer to fill by XLS the SmsList and return it to the next MuleMessage recipient
and next it's my SendListClient that have constructor SendListClient(SmsList list)
that just do proxying
-----
SendListClient(SmsList list) {
port.sendlist(list)
}
-----
but nothing is happend. I'm confused. Gone read man

Thanks

Reply all
Reply to author
Forward
0 new messages