You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by JuliusIT <ri...@yahoo.it> on 2008/11/01 15:03:47 UTC

Re: Null parameter in request and response

Noone has an idea?  Please help me... it' s days i'm hitting my head on the
screen...
I tryed all the solution i find in forum and web. Noone Works. If the
parameter and the response is a simple type there is no problem. As soon as
the parameter are object they are all set to null when i debug it on the
server. I red that is a problem of qualified/unqualified simple /jaxws
frontend. What I don't understand is how if I do:

CXF Server--> WSDL --> CXF client 

things don't works.

Here is how my SEI is defined:

package com.xyz.test.soap;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

@WebService(targetNamespace = "http://soap.test.xyz.com/", name =
"TestSoap")
public interface TestSoapService {
	
    @RequestWrapper(localName = "TestSendFile", targetNamespace =
"http://soap.test.xyz.com/", className = "com.xyz.test.soap.TestSendFile")
    @ResponseWrapper(localName = "TestSendFileResponse", targetNamespace =
"http://soap.test.xyz.com/", className =
"com.xyz.test.soap.TestSendFileResponse")
    @WebMethod
	public TestSendFileResponse
sendFileToTest(@WebParam(name="serviceParameter", targetNamespace =
"http://soap.test.xyz.com/") TestSendFile serviceParameter) throws
InvalidServiceCallException;
    
    @RequestWrapper(localName = "TestReceiveFile", targetNamespace =
"http://soap.test.xyz.com/", className =
"com.xyz.test.soap.TestReceiveFile")
    @ResponseWrapper(localName = "TestReceiveFileResponse", targetNamespace
= "http://soap.test.xyz.com/", className =
"com.xyz.test.soap.TestReceiveFileResponse")
    @WebMethod
    public TestReceiveFileResponse
receiveFileFromTest(@WebParam(name="serviceParameter", targetNamespace =
"http://soap.test.xyz.com/") TestReceiveFile serviceParameter) throws
InvalidServiceCallException;

    @RequestWrapper(localName = "TestGetFilesList", targetNamespace =
"http://soap.test.xyz.com/", className =
"com.xyz.test.soap.TestGetFilesList")
    @ResponseWrapper(localName = "TestGetFilesListResponse", targetNamespace
= "http://soap.test.xyz.com/", className =
"com.xyz.test.soap.TestGetFilesListResponse")
    @WebMethod
    public TestGetFilesListResponse
getFileListFromTest(@WebParam(name="serviceParameter", targetNamespace =
"http://soap.test.xyz.com/") TestGetFilesList serviceParameter) throws
InvalidServiceCallException; 
}

The implementation

package com.xyz.test.soap.services;

import javax.jws.WebService;

import com.xyz.test.soap.TestGetFilesList;
import com.xyz.test.soap.TestGetFilesListResponse;
import com.xyz.test.soap.TestReceiveFile;
import com.xyz.test.soap.TestReceiveFileResponse;
import com.xyz.test.soap.TestSendFile;
import com.xyz.test.soap.TestSendFileResponse;
import com.xyz.test.soap.TestSoapService;
import com.xyz.test.soap.InvalidServiceCallException;


@WebService(portName = "SoapPort", serviceName = "TestSoap", 
            targetNamespace = "http://soap.test.xyz.com/", 
            endpointInterface = "com.xyz.test.soap.TestSoapService")
public class TestSoapServiceImplementation implements TestSoapService {

... my BL here...
}


the client

import java.net.URL;

import com.xyz.test.soap.TestSendFile;
import com.xyz.test.soap.TestSendFileResponse;
import com.xyz.test.soap.TestServiceEncoding;
import com.xyz.test.soap.TestServiceFormats;
import com.xyz.test.soap.TestSoap;
import com.xyz.test.soap.TestSoap_Service;


public final class Client {

	public static void main(String args[]) throws Exception {

        URL wsdlLocation = new
URL("file:/C:/workspace/WsdlToCxf/wsdl/testsoap.wsdl");
		
    	TestSoap_Service service = new TestSoap_Service(wsdlLocation);
        TestSoap port = service.getSoapPort();
        TestSendFileResponse response; 
        
        TestSendFile dfss = new TestSendFile();
        dfss.setUser("test");
        dfss.setPassword("testpass");
        dfss.setEncoding(TestServiceEncoding.BASE_64);
        dfss.setFileName("testfile");
        dfss.setFormat(TestServiceFormats.TXT);
        dfss.setData("testodiprova".getBytes());

        System.out.println("Invoking sendFileToTest...");
        response = port.sendFileToTest(dfss);
        System.out.println("Server responded with code: " +
response.getCode());
        System.out.println("Server responded with message: " +
response.getCode());
        System.out.println();

        System.exit(0); 
    }

}





-- 
View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20280689.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null parameter in request and response

Posted by Daniel Kulp <dk...@apache.org>.
On Saturday 01 November 2008 7:43:58 pm JuliusIT wrote:
> Thanks for the reply
>
> 1) 2.1

Can you please try with 2.1.3 that was released last week.    I think there 
were some fixes in this area between 2.1 and 2.1.1

Dan



> 2) JAXWS, i suppose, as i setted it in the and build for the
> org.apache.cxf.tools.wsdlto.WSDLToJava and
> org.apache.cxf.tools.java2ws.JavaToWS class.
>
> I see many question and many response on the forum like
>
> http://www.nabble.com/Webservice-client-sending-null-parameters-to-host-td1
>5368060.html
>
> or
>
> http://www.nabble.com/Strange-unmarshalling-error.-Request-parameter-become
>s-null.-td19188748.html#a19188748
>
> but i dont'use (maybe I'm wrong) any JaxWsProxyFactoryBean.
>
>
> 1) What version of CXF.
> 2) What front end and data binding.
>
> ?
>
> On Sat, Nov 1, 2008 at 10:03 AM, JuliusIT <ri...@yahoo.it> wrote:
> > Noone has an idea?  Please help me... it' s days i'm hitting my head on
> > the
> > screen...
> > I tryed all the solution i find in forum and web. Noone Works. If the
> > parameter and the response is a simple type there is no problem. As soon
> > as
> > the parameter are object they are all set to null when i debug it on the
> > server. I red that is a problem of qualified/unqualified simple /jaxws
> > frontend. What I don't understand is how if I do:
> >
> > CXF Server--> WSDL --> CXF client
> >
> > things don't works.



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Null parameter in request and response

Posted by JuliusIT <ri...@yahoo.it>.
I got it out, but was really weird (almost for me).

I try a brute force approach, I put of all the annotations, living only
namespaces related annotations and @webservice. I generate the wsdl and then
the client. I copied the generated class in the server and the rebuild the
wsdl. Here come the "fun",  when I try to use WSDLToJava here comes out the
problem. The service parameter were named all the same and this is illegal. 
I rename the parameter and all goes well.
Now I don't still know where is the problem.

1) Something wrong with the generated class, but I don't think so or more
people will hit this problem.
2) Was the parameter issue. But in this case the JavaToWS class should have
pointed it out. I understand that somebody inside soap will never do such an
error, but not everybody is pro soap developer.

This is what I think, maybe I'm wrong, but above is how the story goes.

I'll really like if someone point out the problem as now I know how to solve
but not why the problem was present.

Thanks, really thanks for the time you spent in helping me, Benson.

Giulio




Benson Margulies-4 wrote:
> 
> I'm shooting in the dark. Could you possibly have failed to carry
> \all/ the generated code into the client?
> 
> This business has the general air about it of a namespace
> qualification issue, which could result from a missing
> package-info.class file on one side or the other.
> 
> On Mon, Nov 3, 2008 at 4:02 AM, JuliusIT <ri...@yahoo.it> wrote:
>>
>> Here is my client, some added things for security and encryption, but the
>> null point error was previous to that, so they cannot be the cause:
>>
>>        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>>        factory.getInInterceptors().add(new LoggingInInterceptor());
>>        factory.getOutInterceptors().add(new LoggingOutInterceptor());
>>        factory.setServiceClass(TestSoap.class);
>>        factory.setAddress("http://localhost:9090/SoapPort");
>>        TestSoap client = (TestSoap) factory.create();
>>        org.apache.cxf.endpoint.Client cxfClient =
>> org.apache.cxf.frontend.ClientProxy.getClient(client);
>>        org.apache.cxf.endpoint.Endpoint cxfEndpoint =
>> cxfClient.getEndpoint();
>>        Map<String,Object> outProps = new HashMap<String,Object>();
>>        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
>>
>>        cxfEndpoint.getOutInterceptors().add(wssOut);
>>        outProps.put("mtom-enabled", Boolean.TRUE);
>>        outProps.put(WSHandlerConstants.ACTION,
>> WSHandlerConstants.USERNAME_TOKEN);
>>        //outProps.put(WSHandlerConstants.ACTION,
>> WSHandlerConstants.ENCRYPT);
>>            //outProps.put(WSHandlerConstants.ACTION,
>> WSHandlerConstants.SIGNATURE);
>>            //outProps.put(WSHandlerConstants.ACTION,
>> WSHandlerConstants.USERNAME_TOKEN + WSHandlerConstants.TIMESTAMP + " " +
>> WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT);
>>
>>        outProps.put(WSHandlerConstants.USER, "joe");
>>
>>        outProps.put(WSHandlerConstants.PASSWORD_TYPE,
>> WSConstants.PW_TEXT);
>>            outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
>> ClientPasswordCallback.class.getName());
>>
>>            //outProps.put(WSHandlerConstants.SIG_PROP_FILE,
>> "client_sign.properties");
>>
>> //outProps.put(WSHandlerConstants.ENC_PROP_FILE,"client_sign.properties");
>>
>>
>>
>> Benson Margulies-4 wrote:
>>>
>>> Sadly, your old code should have worked, and there is a way to turn on
>>> logging there via properties. The 'publish' API is JAX-WS. My concern
>>> was that you were using the SimpleServiceFactoryBean. Let's see what
>>> you've got on the client.
>>>
>>> On Sun, Nov 2, 2008 at 7:41 AM, JuliusIT <ri...@yahoo.it> wrote:
>>>>
>>>>
>>>> Benson Margulies-4 wrote:
>>>>>
>>>>> This doesn't show me how you run the service, just how you generated
>>>>> the code. Have you looked at the examples?
>>>>>
>>>>> I need to know how you start your endpoint.
>>>>>
>>>>> Have you read:
>>>>>
>>>>> http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html
>>>>>
>>>>> particularly look for the heading 'Publishing a Service'.
>>>>>
>>>>>
>>>>>
>>>>
>>>> This is how i runned it (like the example, i follow that part, maybe is
>>>> to
>>>> small for what I need).
>>>>
>>>>    protected TestSoapServiceServer() throws Exception {
>>>>        Object implementor = new TestSoapServiceImplementation();
>>>>        String address = "http://localhost:9090/SoapPort";
>>>>        Endpoint.publish(address, implementor);
>>>>    }
>>>>
>>>> Thanks to you I changed to
>>>>
>>>>        DerwidSoapServiceImplementation implementor = new
>>>> DerwidSoapServiceImplementation();
>>>>        JaxWsServerFactoryBean svrFactory = new
>>>> JaxWsServerFactoryBean();
>>>>        svrFactory.setServiceClass(DerwidSoapService.class);
>>>>        svrFactory.setAddress("http://localhost:9090/SoapPort");
>>>>        svrFactory.setServiceBean(implementor);
>>>>        svrFactory.getInInterceptors().add(new LoggingInInterceptor());
>>>>        svrFactory.getOutInterceptors().add(new
>>>> LoggingOutInterceptor());
>>>>        svrFactory.create();
>>>>
>>>> so now I can supply my server logging (as I should have done from the
>>>> beginning...)
>>>>
>>>>
>>>> 2-nov-2008 13.35.04 org.apache.cxf.interceptor.LoggingInInterceptor
>>>> logging
>>>> INFO: Inbound Message
>>>> ----------------------------
>>>> Encoding: UTF-8
>>>> Headers: {content-type=[text/xml; charset=UTF-8],
>>>> connection=[keep-alive],
>>>> transfer-encoding=[chunked], Host=[localhost:9090], SOAPAction=[""],
>>>> User-Agent=[Java/1.6.0_07], Accept=[*], Pragma=[no-cache],
>>>> Cache-Control=[no-cache]}
>>>> Messages:
>>>> Message:
>>>>
>>>> Payload: <soap:Envelope
>>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFile
>>>> xmlns:ns2="http://soap.test.xyz.com/"><data>dGVzdG9kaXByb3Zh</data><encoding>BASE64</encoding><fileName>testfile</fileName><format>TXT</format><password>testpass</password><user>test</user></ns2:TestSendFile></soap:Body></soap:Envelope>
>>>> --------------------------------------
>>>> 2-nov-2008 13.35.04
>>>> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback
>>>> onClose
>>>> INFO: Outbound Message
>>>> ---------------------------
>>>> Encoding: UTF-8
>>>> Headers: {SOAPAction=[""]}
>>>> Messages:
>>>> Payload: <soap:Envelope
>>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFileResponse
>>>> xmlns:ns2="http://soap.test.xyz.com/"><code>0</code></ns2:TestSendFileResponse></soap:Body></soap:Envelope>
>>>>
>>>> As I can see the incoming soap message are correct but the response
>>>> not,
>>>> should be some code error with message. I can't understand. I know this
>>>> should be a unqualified/qualified issue, but I can't understand where
>>>> is
>>>> the
>>>> problem, maybe is how i initialize the client. I'll also check it
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20289413.html
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20299222.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20305918.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null parameter in request and response

Posted by Benson Margulies <bi...@gmail.com>.
I'm shooting in the dark. Could you possibly have failed to carry
\all/ the generated code into the client?

This business has the general air about it of a namespace
qualification issue, which could result from a missing
package-info.class file on one side or the other.

On Mon, Nov 3, 2008 at 4:02 AM, JuliusIT <ri...@yahoo.it> wrote:
>
> Here is my client, some added things for security and encryption, but the
> null point error was previous to that, so they cannot be the cause:
>
>        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>        factory.getInInterceptors().add(new LoggingInInterceptor());
>        factory.getOutInterceptors().add(new LoggingOutInterceptor());
>        factory.setServiceClass(TestSoap.class);
>        factory.setAddress("http://localhost:9090/SoapPort");
>        TestSoap client = (TestSoap) factory.create();
>        org.apache.cxf.endpoint.Client cxfClient =
> org.apache.cxf.frontend.ClientProxy.getClient(client);
>        org.apache.cxf.endpoint.Endpoint cxfEndpoint =
> cxfClient.getEndpoint();
>        Map<String,Object> outProps = new HashMap<String,Object>();
>        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
>
>        cxfEndpoint.getOutInterceptors().add(wssOut);
>        outProps.put("mtom-enabled", Boolean.TRUE);
>        outProps.put(WSHandlerConstants.ACTION,
> WSHandlerConstants.USERNAME_TOKEN);
>        //outProps.put(WSHandlerConstants.ACTION,
> WSHandlerConstants.ENCRYPT);
>            //outProps.put(WSHandlerConstants.ACTION,
> WSHandlerConstants.SIGNATURE);
>            //outProps.put(WSHandlerConstants.ACTION,
> WSHandlerConstants.USERNAME_TOKEN + WSHandlerConstants.TIMESTAMP + " " +
> WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT);
>
>        outProps.put(WSHandlerConstants.USER, "joe");
>
>        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
>            outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
> ClientPasswordCallback.class.getName());
>
>            //outProps.put(WSHandlerConstants.SIG_PROP_FILE,
> "client_sign.properties");
>
> //outProps.put(WSHandlerConstants.ENC_PROP_FILE,"client_sign.properties");
>
>
>
> Benson Margulies-4 wrote:
>>
>> Sadly, your old code should have worked, and there is a way to turn on
>> logging there via properties. The 'publish' API is JAX-WS. My concern
>> was that you were using the SimpleServiceFactoryBean. Let's see what
>> you've got on the client.
>>
>> On Sun, Nov 2, 2008 at 7:41 AM, JuliusIT <ri...@yahoo.it> wrote:
>>>
>>>
>>> Benson Margulies-4 wrote:
>>>>
>>>> This doesn't show me how you run the service, just how you generated
>>>> the code. Have you looked at the examples?
>>>>
>>>> I need to know how you start your endpoint.
>>>>
>>>> Have you read:
>>>>
>>>> http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html
>>>>
>>>> particularly look for the heading 'Publishing a Service'.
>>>>
>>>>
>>>>
>>>
>>> This is how i runned it (like the example, i follow that part, maybe is
>>> to
>>> small for what I need).
>>>
>>>    protected TestSoapServiceServer() throws Exception {
>>>        Object implementor = new TestSoapServiceImplementation();
>>>        String address = "http://localhost:9090/SoapPort";
>>>        Endpoint.publish(address, implementor);
>>>    }
>>>
>>> Thanks to you I changed to
>>>
>>>        DerwidSoapServiceImplementation implementor = new
>>> DerwidSoapServiceImplementation();
>>>        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
>>>        svrFactory.setServiceClass(DerwidSoapService.class);
>>>        svrFactory.setAddress("http://localhost:9090/SoapPort");
>>>        svrFactory.setServiceBean(implementor);
>>>        svrFactory.getInInterceptors().add(new LoggingInInterceptor());
>>>        svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
>>>        svrFactory.create();
>>>
>>> so now I can supply my server logging (as I should have done from the
>>> beginning...)
>>>
>>>
>>> 2-nov-2008 13.35.04 org.apache.cxf.interceptor.LoggingInInterceptor
>>> logging
>>> INFO: Inbound Message
>>> ----------------------------
>>> Encoding: UTF-8
>>> Headers: {content-type=[text/xml; charset=UTF-8],
>>> connection=[keep-alive],
>>> transfer-encoding=[chunked], Host=[localhost:9090], SOAPAction=[""],
>>> User-Agent=[Java/1.6.0_07], Accept=[*], Pragma=[no-cache],
>>> Cache-Control=[no-cache]}
>>> Messages:
>>> Message:
>>>
>>> Payload: <soap:Envelope
>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFile
>>> xmlns:ns2="http://soap.test.xyz.com/"><data>dGVzdG9kaXByb3Zh</data><encoding>BASE64</encoding><fileName>testfile</fileName><format>TXT</format><password>testpass</password><user>test</user></ns2:TestSendFile></soap:Body></soap:Envelope>
>>> --------------------------------------
>>> 2-nov-2008 13.35.04
>>> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>>> INFO: Outbound Message
>>> ---------------------------
>>> Encoding: UTF-8
>>> Headers: {SOAPAction=[""]}
>>> Messages:
>>> Payload: <soap:Envelope
>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFileResponse
>>> xmlns:ns2="http://soap.test.xyz.com/"><code>0</code></ns2:TestSendFileResponse></soap:Body></soap:Envelope>
>>>
>>> As I can see the incoming soap message are correct but the response not,
>>> should be some code error with message. I can't understand. I know this
>>> should be a unqualified/qualified issue, but I can't understand where is
>>> the
>>> problem, maybe is how i initialize the client. I'll also check it
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20289413.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20299222.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Null parameter in request and response

Posted by JuliusIT <ri...@yahoo.it>.
Here is my client, some added things for security and encryption, but the
null point error was previous to that, so they cannot be the cause:

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.getInInterceptors().add(new LoggingInInterceptor());
        factory.getOutInterceptors().add(new LoggingOutInterceptor());
        factory.setServiceClass(TestSoap.class);
        factory.setAddress("http://localhost:9090/SoapPort");
        TestSoap client = (TestSoap) factory.create();
        org.apache.cxf.endpoint.Client cxfClient =
org.apache.cxf.frontend.ClientProxy.getClient(client);
        org.apache.cxf.endpoint.Endpoint cxfEndpoint =
cxfClient.getEndpoint();
        Map<String,Object> outProps = new HashMap<String,Object>();
        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
        
        cxfEndpoint.getOutInterceptors().add(wssOut);
        outProps.put("mtom-enabled", Boolean.TRUE);
        outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN);
        //outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.ENCRYPT); 
	    //outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.SIGNATURE);
	    //outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN + WSHandlerConstants.TIMESTAMP + " " +
WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT);
	    
        outProps.put(WSHandlerConstants.USER, "joe");
	    
        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
	    outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
ClientPasswordCallback.class.getName());
	    
	    //outProps.put(WSHandlerConstants.SIG_PROP_FILE,
"client_sign.properties");
	   
//outProps.put(WSHandlerConstants.ENC_PROP_FILE,"client_sign.properties"); 



Benson Margulies-4 wrote:
> 
> Sadly, your old code should have worked, and there is a way to turn on
> logging there via properties. The 'publish' API is JAX-WS. My concern
> was that you were using the SimpleServiceFactoryBean. Let's see what
> you've got on the client.
> 
> On Sun, Nov 2, 2008 at 7:41 AM, JuliusIT <ri...@yahoo.it> wrote:
>>
>>
>> Benson Margulies-4 wrote:
>>>
>>> This doesn't show me how you run the service, just how you generated
>>> the code. Have you looked at the examples?
>>>
>>> I need to know how you start your endpoint.
>>>
>>> Have you read:
>>>
>>> http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html
>>>
>>> particularly look for the heading 'Publishing a Service'.
>>>
>>>
>>>
>>
>> This is how i runned it (like the example, i follow that part, maybe is
>> to
>> small for what I need).
>>
>>    protected TestSoapServiceServer() throws Exception {
>>        Object implementor = new TestSoapServiceImplementation();
>>        String address = "http://localhost:9090/SoapPort";
>>        Endpoint.publish(address, implementor);
>>    }
>>
>> Thanks to you I changed to
>>
>>        DerwidSoapServiceImplementation implementor = new
>> DerwidSoapServiceImplementation();
>>        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
>>        svrFactory.setServiceClass(DerwidSoapService.class);
>>        svrFactory.setAddress("http://localhost:9090/SoapPort");
>>        svrFactory.setServiceBean(implementor);
>>        svrFactory.getInInterceptors().add(new LoggingInInterceptor());
>>        svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
>>        svrFactory.create();
>>
>> so now I can supply my server logging (as I should have done from the
>> beginning...)
>>
>>
>> 2-nov-2008 13.35.04 org.apache.cxf.interceptor.LoggingInInterceptor
>> logging
>> INFO: Inbound Message
>> ----------------------------
>> Encoding: UTF-8
>> Headers: {content-type=[text/xml; charset=UTF-8],
>> connection=[keep-alive],
>> transfer-encoding=[chunked], Host=[localhost:9090], SOAPAction=[""],
>> User-Agent=[Java/1.6.0_07], Accept=[*], Pragma=[no-cache],
>> Cache-Control=[no-cache]}
>> Messages:
>> Message:
>>
>> Payload: <soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFile
>> xmlns:ns2="http://soap.test.xyz.com/"><data>dGVzdG9kaXByb3Zh</data><encoding>BASE64</encoding><fileName>testfile</fileName><format>TXT</format><password>testpass</password><user>test</user></ns2:TestSendFile></soap:Body></soap:Envelope>
>> --------------------------------------
>> 2-nov-2008 13.35.04
>> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>> INFO: Outbound Message
>> ---------------------------
>> Encoding: UTF-8
>> Headers: {SOAPAction=[""]}
>> Messages:
>> Payload: <soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFileResponse
>> xmlns:ns2="http://soap.test.xyz.com/"><code>0</code></ns2:TestSendFileResponse></soap:Body></soap:Envelope>
>>
>> As I can see the incoming soap message are correct but the response not,
>> should be some code error with message. I can't understand. I know this
>> should be a unqualified/qualified issue, but I can't understand where is
>> the
>> problem, maybe is how i initialize the client. I'll also check it
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20289413.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20299222.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null parameter in request and response

Posted by Benson Margulies <bi...@gmail.com>.
Sadly, your old code should have worked, and there is a way to turn on
logging there via properties. The 'publish' API is JAX-WS. My concern
was that you were using the SimpleServiceFactoryBean. Let's see what
you've got on the client.

On Sun, Nov 2, 2008 at 7:41 AM, JuliusIT <ri...@yahoo.it> wrote:
>
>
> Benson Margulies-4 wrote:
>>
>> This doesn't show me how you run the service, just how you generated
>> the code. Have you looked at the examples?
>>
>> I need to know how you start your endpoint.
>>
>> Have you read:
>>
>> http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html
>>
>> particularly look for the heading 'Publishing a Service'.
>>
>>
>>
>
> This is how i runned it (like the example, i follow that part, maybe is to
> small for what I need).
>
>    protected TestSoapServiceServer() throws Exception {
>        Object implementor = new TestSoapServiceImplementation();
>        String address = "http://localhost:9090/SoapPort";
>        Endpoint.publish(address, implementor);
>    }
>
> Thanks to you I changed to
>
>        DerwidSoapServiceImplementation implementor = new
> DerwidSoapServiceImplementation();
>        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
>        svrFactory.setServiceClass(DerwidSoapService.class);
>        svrFactory.setAddress("http://localhost:9090/SoapPort");
>        svrFactory.setServiceBean(implementor);
>        svrFactory.getInInterceptors().add(new LoggingInInterceptor());
>        svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
>        svrFactory.create();
>
> so now I can supply my server logging (as I should have done from the
> beginning...)
>
>
> 2-nov-2008 13.35.04 org.apache.cxf.interceptor.LoggingInInterceptor logging
> INFO: Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers: {content-type=[text/xml; charset=UTF-8], connection=[keep-alive],
> transfer-encoding=[chunked], Host=[localhost:9090], SOAPAction=[""],
> User-Agent=[Java/1.6.0_07], Accept=[*], Pragma=[no-cache],
> Cache-Control=[no-cache]}
> Messages:
> Message:
>
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFile
> xmlns:ns2="http://soap.test.xyz.com/"><data>dGVzdG9kaXByb3Zh</data><encoding>BASE64</encoding><fileName>testfile</fileName><format>TXT</format><password>testpass</password><user>test</user></ns2:TestSendFile></soap:Body></soap:Envelope>
> --------------------------------------
> 2-nov-2008 13.35.04
> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> INFO: Outbound Message
> ---------------------------
> Encoding: UTF-8
> Headers: {SOAPAction=[""]}
> Messages:
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFileResponse
> xmlns:ns2="http://soap.test.xyz.com/"><code>0</code></ns2:TestSendFileResponse></soap:Body></soap:Envelope>
>
> As I can see the incoming soap message are correct but the response not,
> should be some code error with message. I can't understand. I know this
> should be a unqualified/qualified issue, but I can't understand where is the
> problem, maybe is how i initialize the client. I'll also check it
>
> --
> View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20289413.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Null parameter in request and response

Posted by JuliusIT <ri...@yahoo.it>.

Benson Margulies-4 wrote:
> 
> This doesn't show me how you run the service, just how you generated
> the code. Have you looked at the examples?
> 
> I need to know how you start your endpoint.
> 
> Have you read:
> 
> http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html
> 
> particularly look for the heading 'Publishing a Service'.
> 
> 
> 

This is how i runned it (like the example, i follow that part, maybe is to
small for what I need).

    protected TestSoapServiceServer() throws Exception {
        Object implementor = new TestSoapServiceImplementation();
        String address = "http://localhost:9090/SoapPort";
        Endpoint.publish(address, implementor);
    }

Thanks to you I changed to 

    	DerwidSoapServiceImplementation implementor = new
DerwidSoapServiceImplementation();
    	JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
    	svrFactory.setServiceClass(DerwidSoapService.class);
    	svrFactory.setAddress("http://localhost:9090/SoapPort");
    	svrFactory.setServiceBean(implementor);
    	svrFactory.getInInterceptors().add(new LoggingInInterceptor());
    	svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
    	svrFactory.create();

so now I can supply my server logging (as I should have done from the
beginning...)


2-nov-2008 13.35.04 org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {content-type=[text/xml; charset=UTF-8], connection=[keep-alive],
transfer-encoding=[chunked], Host=[localhost:9090], SOAPAction=[""],
User-Agent=[Java/1.6.0_07], Accept=[*], Pragma=[no-cache],
Cache-Control=[no-cache]}
Messages: 
Message:

Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFile
xmlns:ns2="http://soap.test.xyz.com/"><data>dGVzdG9kaXByb3Zh</data><encoding>BASE64</encoding><fileName>testfile</fileName><format>TXT</format><password>testpass</password><user>test</user></ns2:TestSendFile></soap:Body></soap:Envelope>
--------------------------------------
2-nov-2008 13.35.04
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
Encoding: UTF-8
Headers: {SOAPAction=[""]}
Messages: 
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:TestSendFileResponse
xmlns:ns2="http://soap.test.xyz.com/"><code>0</code></ns2:TestSendFileResponse></soap:Body></soap:Envelope>

As I can see the incoming soap message are correct but the response not,
should be some code error with message. I can't understand. I know this
should be a unqualified/qualified issue, but I can't understand where is the
problem, maybe is how i initialize the client. I'll also check it 

-- 
View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20289413.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null parameter in request and response

Posted by Benson Margulies <bi...@gmail.com>.
This doesn't show me how you run the service, just how you generated
the code. Have you looked at the examples?

I need to know how you start your endpoint.

Have you read:

http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html

particularly look for the heading 'Publishing a Service'.



On Sun, Nov 2, 2008 at 3:09 AM, JuliusIT <ri...@yahoo.it> wrote:
>
>
> Benson Margulies-4 wrote:
>>
>> Are you configured from Spring or the API? Either way, you have to use
>> the JaxWs factory or the JAX-WS standard classes, NOT the Simple...
>> classes. Perhaps you could post up some configuration?
>>
>
> I configure from the Api. I don't thought i was supposed to configure the
> JaxWs factory, i never red it on the user guide, and in the generated client
> classes there is no place where the factory comes out.
> On the server side I don't place any factory, and I don't think I need one.
> If this is an error, I'm sorry, but I'm new. In the example I tryed all the
> parameter and response are primitive type, no object. So I cant' figure out
> the problem. The last thing I have are the ant build.
>
> <?xml version="1.0"?>
> <project name="TestSoapServer" basedir="." default="cxfJavaToWS">
>   <property name="cxf.home" location ="C:\librerie\apache-cxf-2.1\"/>
>   <property name="build.classes.dir" location
> ="C:\workspace\CxfToWsdl\bin"/>
>
>   <path id="cxf.classpath">
>      <pathelement location="${build.classes.dir}"/>
>      <fileset dir="${cxf.home}/lib">
>         <include name="*.jar"/>
>      </fileset>
>   </path>
>
>   <target name="cxfJavaToWS">
>      <java classname="org.apache.cxf.tools.java2ws.JavaToWS" fork="true">
>         <arg value="-wsdl"/>
>         <arg value="-o"/>
>         <arg value="Testsoap.wsdl"/>
>         <arg value="-frontend"/>
>         <arg value="jaxws"/>
>         <arg value="-servicename"/>
>         <arg value="TestSoap"/>
>         <arg value="-portname"/>
>         <arg value="SoapPort"/>
>         <arg value="com.xyz.Test.soap.TestSoapService"/>
>         <classpath>
>            <path refid="cxf.classpath"/>
>         </classpath>
>      </java>
>   </target>
> </project>
>
>
> <?xml version="1.0"?>
> <project name="TestSoapServer" basedir="." default="cxfWSDLToJava">
>   <property name="cxf.home" location ="C:\librerie\apache-cxf-2.1\"/>
>
>   <path id="cxf.classpath">
>      <fileset dir="${cxf.home}/lib">
>         <include name="*.jar"/>
>      </fileset>
>   </path>
>
>   <target name="cxfWSDLToJava">
>      <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
>         <arg value="-client"/>
>         <arg value="-d"/>
>         <arg value="../src"/>
>         <arg value="Testsoap.wsdl"/>
>         <classpath>
>            <path refid="cxf.classpath"/>
>         </classpath>
>      </java>
>   </target>
> </project>
>
> --
> View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20287788.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Null parameter in request and response

Posted by JuliusIT <ri...@yahoo.it>.

Benson Margulies-4 wrote:
> 
> Are you configured from Spring or the API? Either way, you have to use
> the JaxWs factory or the JAX-WS standard classes, NOT the Simple...
> classes. Perhaps you could post up some configuration?
> 

I configure from the Api. I don't thought i was supposed to configure the
JaxWs factory, i never red it on the user guide, and in the generated client
classes there is no place where the factory comes out. 
On the server side I don't place any factory, and I don't think I need one. 
If this is an error, I'm sorry, but I'm new. In the example I tryed all the
parameter and response are primitive type, no object. So I cant' figure out
the problem. The last thing I have are the ant build.

<?xml version="1.0"?>
<project name="TestSoapServer" basedir="." default="cxfJavaToWS">   
   <property name="cxf.home" location ="C:\librerie\apache-cxf-2.1\"/>
   <property name="build.classes.dir" location
="C:\workspace\CxfToWsdl\bin"/>

   <path id="cxf.classpath">
      <pathelement location="${build.classes.dir}"/>
      <fileset dir="${cxf.home}/lib">
         <include name="*.jar"/>
      </fileset>
   </path>
      
   <target name="cxfJavaToWS">
      <java classname="org.apache.cxf.tools.java2ws.JavaToWS" fork="true">
      	 <arg value="-wsdl"/>
         <arg value="-o"/>
         <arg value="Testsoap.wsdl"/>
      	 <arg value="-frontend"/>
      	 <arg value="jaxws"/>
      	 <arg value="-servicename"/>
      	 <arg value="TestSoap"/>
      	 <arg value="-portname"/>
      	 <arg value="SoapPort"/>
         <arg value="com.xyz.Test.soap.TestSoapService"/>
         <classpath>
            <path refid="cxf.classpath"/>
         </classpath>
      </java>
   </target>
</project>


<?xml version="1.0"?>
<project name="TestSoapServer" basedir="." default="cxfWSDLToJava">   
   <property name="cxf.home" location ="C:\librerie\apache-cxf-2.1\"/>

   <path id="cxf.classpath">
      <fileset dir="${cxf.home}/lib">
         <include name="*.jar"/>
      </fileset>
   </path>
      
   <target name="cxfWSDLToJava">
      <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
         <arg value="-client"/>
         <arg value="-d"/>
         <arg value="../src"/>
         <arg value="Testsoap.wsdl"/>
         <classpath>
            <path refid="cxf.classpath"/>
         </classpath>
      </java>
   </target>
</project>

-- 
View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20287788.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JAX-RS Array Serialization Issues

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 13 December 2010 9:26:19 pm Wong wrote:
> Hi,
> 
> I ran into the problem listed at:
> http://cxf.apache.org/docs/jax-rs.html#JAX-RS-DealingwithJSONarrayserializa
> tionissues
> 
> Is it necessary to set the arrayKeys list for the this to work?

Yes.

> Can I get
> all lists of size 1 to serialize properly?

Not without the arrayKeys set.   The basic reason is that we just feed the 
JAXB marshaller an XMLStreamWriter that happens to output JSON.  The writers 
have no idea what they are writing.    They just get events like startElement 
and such.   For any given startElement, it needs to know if it should output 
it as a json array or not.   It's not something JAXB provides to the writer.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

JAX-RS Array Serialization Issues

Posted by Wong <up...@yahoo.com>.
Hi,

I ran into the problem listed at: 
http://cxf.apache.org/docs/jax-rs.html#JAX-RS-DealingwithJSONarrayserializationissues


Is it necessary to set the arrayKeys list for the this to work?  Can I get all 
lists of size 1 to serialize properly?  


Thanks,
-Robert


      

Re: Null parameter in request and response

Posted by Benson Margulies <bi...@gmail.com>.
Are you configured from Spring or the API? Either way, you have to use
the JaxWs factory or the JAX-WS standard classes, NOT the Simple...
classes. Perhaps you could post up some configuration?

On Sat, Nov 1, 2008 at 7:43 PM, JuliusIT <ri...@yahoo.it> wrote:
>
> Thanks for the reply
>
> 1) 2.1
> 2) JAXWS, i suppose, as i setted it in the and build for the
> org.apache.cxf.tools.wsdlto.WSDLToJava and
> org.apache.cxf.tools.java2ws.JavaToWS class.
>
> I see many question and many response on the forum like
>
> http://www.nabble.com/Webservice-client-sending-null-parameters-to-host-td15368060.html
>
> or
>
> http://www.nabble.com/Strange-unmarshalling-error.-Request-parameter-becomes-null.-td19188748.html#a19188748
>
> but i dont'use (maybe I'm wrong) any JaxWsProxyFactoryBean.
>
>
> 1) What version of CXF.
> 2) What front end and data binding.
>
> ?
>
>
> On Sat, Nov 1, 2008 at 10:03 AM, JuliusIT <ri...@yahoo.it> wrote:
>>
>> Noone has an idea?  Please help me... it' s days i'm hitting my head on
>> the
>> screen...
>> I tryed all the solution i find in forum and web. Noone Works. If the
>> parameter and the response is a simple type there is no problem. As soon
>> as
>> the parameter are object they are all set to null when i debug it on the
>> server. I red that is a problem of qualified/unqualified simple /jaxws
>> frontend. What I don't understand is how if I do:
>>
>> CXF Server--> WSDL --> CXF client
>>
>> things don't works.
>>
>
>
> --
> View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20285540.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Null parameter in request and response

Posted by JuliusIT <ri...@yahoo.it>.
Thanks for the reply

1) 2.1
2) JAXWS, i suppose, as i setted it in the and build for the
org.apache.cxf.tools.wsdlto.WSDLToJava and
org.apache.cxf.tools.java2ws.JavaToWS class.

I see many question and many response on the forum like

http://www.nabble.com/Webservice-client-sending-null-parameters-to-host-td15368060.html

or 

http://www.nabble.com/Strange-unmarshalling-error.-Request-parameter-becomes-null.-td19188748.html#a19188748

but i dont'use (maybe I'm wrong) any JaxWsProxyFactoryBean.


1) What version of CXF.
2) What front end and data binding.

?


On Sat, Nov 1, 2008 at 10:03 AM, JuliusIT <ri...@yahoo.it> wrote:
>
> Noone has an idea?  Please help me... it' s days i'm hitting my head on
> the
> screen...
> I tryed all the solution i find in forum and web. Noone Works. If the
> parameter and the response is a simple type there is no problem. As soon
> as
> the parameter are object they are all set to null when i debug it on the
> server. I red that is a problem of qualified/unqualified simple /jaxws
> frontend. What I don't understand is how if I do:
>
> CXF Server--> WSDL --> CXF client
>
> things don't works.
>


-- 
View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20285540.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null parameter in request and response

Posted by Benson Margulies <bi...@gmail.com>.
1) What version of CXF.
2) What front end and data binding.

?


On Sat, Nov 1, 2008 at 10:03 AM, JuliusIT <ri...@yahoo.it> wrote:
>
> Noone has an idea?  Please help me... it' s days i'm hitting my head on the
> screen...
> I tryed all the solution i find in forum and web. Noone Works. If the
> parameter and the response is a simple type there is no problem. As soon as
> the parameter are object they are all set to null when i debug it on the
> server. I red that is a problem of qualified/unqualified simple /jaxws
> frontend. What I don't understand is how if I do:
>
> CXF Server--> WSDL --> CXF client
>
> things don't works.
>
> Here is how my SEI is defined:
>
> package com.xyz.test.soap;
>
> import javax.jws.WebMethod;
> import javax.jws.WebParam;
> import javax.jws.WebService;
> import javax.xml.ws.RequestWrapper;
> import javax.xml.ws.ResponseWrapper;
>
> @WebService(targetNamespace = "http://soap.test.xyz.com/", name =
> "TestSoap")
> public interface TestSoapService {
>
>    @RequestWrapper(localName = "TestSendFile", targetNamespace =
> "http://soap.test.xyz.com/", className = "com.xyz.test.soap.TestSendFile")
>    @ResponseWrapper(localName = "TestSendFileResponse", targetNamespace =
> "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestSendFileResponse")
>    @WebMethod
>        public TestSendFileResponse
> sendFileToTest(@WebParam(name="serviceParameter", targetNamespace =
> "http://soap.test.xyz.com/") TestSendFile serviceParameter) throws
> InvalidServiceCallException;
>
>    @RequestWrapper(localName = "TestReceiveFile", targetNamespace =
> "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestReceiveFile")
>    @ResponseWrapper(localName = "TestReceiveFileResponse", targetNamespace
> = "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestReceiveFileResponse")
>    @WebMethod
>    public TestReceiveFileResponse
> receiveFileFromTest(@WebParam(name="serviceParameter", targetNamespace =
> "http://soap.test.xyz.com/") TestReceiveFile serviceParameter) throws
> InvalidServiceCallException;
>
>    @RequestWrapper(localName = "TestGetFilesList", targetNamespace =
> "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestGetFilesList")
>    @ResponseWrapper(localName = "TestGetFilesListResponse", targetNamespace
> = "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestGetFilesListResponse")
>    @WebMethod
>    public TestGetFilesListResponse
> getFileListFromTest(@WebParam(name="serviceParameter", targetNamespace =
> "http://soap.test.xyz.com/") TestGetFilesList serviceParameter) throws
> InvalidServiceCallException;
> }
>
> The implementation
>
> package com.xyz.test.soap.services;
>
> import javax.jws.WebService;
>
> import com.xyz.test.soap.TestGetFilesList;
> import com.xyz.test.soap.TestGetFilesListResponse;
> import com.xyz.test.soap.TestReceiveFile;
> import com.xyz.test.soap.TestReceiveFileResponse;
> import com.xyz.test.soap.TestSendFile;
> import com.xyz.test.soap.TestSendFileResponse;
> import com.xyz.test.soap.TestSoapService;
> import com.xyz.test.soap.InvalidServiceCallException;
>
>
> @WebService(portName = "SoapPort", serviceName = "TestSoap",
>            targetNamespace = "http://soap.test.xyz.com/",
>            endpointInterface = "com.xyz.test.soap.TestSoapService")
> public class TestSoapServiceImplementation implements TestSoapService {
>
> ... my BL here...
> }
>
>
> the client
>
> import java.net.URL;
>
> import com.xyz.test.soap.TestSendFile;
> import com.xyz.test.soap.TestSendFileResponse;
> import com.xyz.test.soap.TestServiceEncoding;
> import com.xyz.test.soap.TestServiceFormats;
> import com.xyz.test.soap.TestSoap;
> import com.xyz.test.soap.TestSoap_Service;
>
>
> public final class Client {
>
>        public static void main(String args[]) throws Exception {
>
>        URL wsdlLocation = new
> URL("file:/C:/workspace/WsdlToCxf/wsdl/testsoap.wsdl");
>
>        TestSoap_Service service = new TestSoap_Service(wsdlLocation);
>        TestSoap port = service.getSoapPort();
>        TestSendFileResponse response;
>
>        TestSendFile dfss = new TestSendFile();
>        dfss.setUser("test");
>        dfss.setPassword("testpass");
>        dfss.setEncoding(TestServiceEncoding.BASE_64);
>        dfss.setFileName("testfile");
>        dfss.setFormat(TestServiceFormats.TXT);
>        dfss.setData("testodiprova".getBytes());
>
>        System.out.println("Invoking sendFileToTest...");
>        response = port.sendFileToTest(dfss);
>        System.out.println("Server responded with code: " +
> response.getCode());
>        System.out.println("Server responded with message: " +
> response.getCode());
>        System.out.println();
>
>        System.exit(0);
>    }
>
> }
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Null-parameter-in-request-and-response-tp20255751p20280689.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Null parameter in request and response

Posted by Daniel Kulp <dk...@apache.org>.
Your CXF server is a "code first" server and thus wouldn't be using your 
provided WSDL.   Thus, there COULD be a slight disconnect with what it's 
expecting and what the client is sending.    

My suggestion would be to add a wsdlLocation attribute to:
> @WebService(portName = "SoapPort", serviceName = "TestSoap",
>             targetNamespace = "http://soap.test.xyz.com/",
>             endpointInterface = "com.xyz.test.soap.TestSoapService")
to point it at the actual wsdl.   That should make both the client and the 
server use the exact same wsdl and should hopefully  solve this.

Dan


On Saturday 01 November 2008 10:03:47 am JuliusIT wrote:
> Noone has an idea?  Please help me... it' s days i'm hitting my head on the
> screen...
> I tryed all the solution i find in forum and web. Noone Works. If the
> parameter and the response is a simple type there is no problem. As soon as
> the parameter are object they are all set to null when i debug it on the
> server. I red that is a problem of qualified/unqualified simple /jaxws
> frontend. What I don't understand is how if I do:
>
> CXF Server--> WSDL --> CXF client
>
> things don't works.
>
> Here is how my SEI is defined:
>
> package com.xyz.test.soap;
>
> import javax.jws.WebMethod;
> import javax.jws.WebParam;
> import javax.jws.WebService;
> import javax.xml.ws.RequestWrapper;
> import javax.xml.ws.ResponseWrapper;
>
> @WebService(targetNamespace = "http://soap.test.xyz.com/", name =
> "TestSoap")
> public interface TestSoapService {
>
>     @RequestWrapper(localName = "TestSendFile", targetNamespace =
> "http://soap.test.xyz.com/", className = "com.xyz.test.soap.TestSendFile")
>     @ResponseWrapper(localName = "TestSendFileResponse", targetNamespace =
> "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestSendFileResponse")
>     @WebMethod
> 	public TestSendFileResponse
> sendFileToTest(@WebParam(name="serviceParameter", targetNamespace =
> "http://soap.test.xyz.com/") TestSendFile serviceParameter) throws
> InvalidServiceCallException;
>
>     @RequestWrapper(localName = "TestReceiveFile", targetNamespace =
> "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestReceiveFile")
>     @ResponseWrapper(localName = "TestReceiveFileResponse", targetNamespace
> = "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestReceiveFileResponse")
>     @WebMethod
>     public TestReceiveFileResponse
> receiveFileFromTest(@WebParam(name="serviceParameter", targetNamespace =
> "http://soap.test.xyz.com/") TestReceiveFile serviceParameter) throws
> InvalidServiceCallException;
>
>     @RequestWrapper(localName = "TestGetFilesList", targetNamespace =
> "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestGetFilesList")
>     @ResponseWrapper(localName = "TestGetFilesListResponse",
> targetNamespace = "http://soap.test.xyz.com/", className =
> "com.xyz.test.soap.TestGetFilesListResponse")
>     @WebMethod
>     public TestGetFilesListResponse
> getFileListFromTest(@WebParam(name="serviceParameter", targetNamespace =
> "http://soap.test.xyz.com/") TestGetFilesList serviceParameter) throws
> InvalidServiceCallException;
> }
>
> The implementation
>
> package com.xyz.test.soap.services;
>
> import javax.jws.WebService;
>
> import com.xyz.test.soap.TestGetFilesList;
> import com.xyz.test.soap.TestGetFilesListResponse;
> import com.xyz.test.soap.TestReceiveFile;
> import com.xyz.test.soap.TestReceiveFileResponse;
> import com.xyz.test.soap.TestSendFile;
> import com.xyz.test.soap.TestSendFileResponse;
> import com.xyz.test.soap.TestSoapService;
> import com.xyz.test.soap.InvalidServiceCallException;
>
>
> @WebService(portName = "SoapPort", serviceName = "TestSoap",
>             targetNamespace = "http://soap.test.xyz.com/",
>             endpointInterface = "com.xyz.test.soap.TestSoapService")
> public class TestSoapServiceImplementation implements TestSoapService {
>
> ... my BL here...
> }
>
>
> the client
>
> import java.net.URL;
>
> import com.xyz.test.soap.TestSendFile;
> import com.xyz.test.soap.TestSendFileResponse;
> import com.xyz.test.soap.TestServiceEncoding;
> import com.xyz.test.soap.TestServiceFormats;
> import com.xyz.test.soap.TestSoap;
> import com.xyz.test.soap.TestSoap_Service;
>
>
> public final class Client {
>
> 	public static void main(String args[]) throws Exception {
>
>         URL wsdlLocation = new
> URL("file:/C:/workspace/WsdlToCxf/wsdl/testsoap.wsdl");
>
>     	TestSoap_Service service = new TestSoap_Service(wsdlLocation);
>         TestSoap port = service.getSoapPort();
>         TestSendFileResponse response;
>
>         TestSendFile dfss = new TestSendFile();
>         dfss.setUser("test");
>         dfss.setPassword("testpass");
>         dfss.setEncoding(TestServiceEncoding.BASE_64);
>         dfss.setFileName("testfile");
>         dfss.setFormat(TestServiceFormats.TXT);
>         dfss.setData("testodiprova".getBytes());
>
>         System.out.println("Invoking sendFileToTest...");
>         response = port.sendFileToTest(dfss);
>         System.out.println("Server responded with code: " +
> response.getCode());
>         System.out.println("Server responded with message: " +
> response.getCode());
>         System.out.println();
>
>         System.exit(0);
>     }
>
> }



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog