cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <>
Subject [jira] [Commented] (CXF-5306) Soap body in header
Date Fri, 27 Sep 2013 17:29:02 GMT


Daniel Kulp commented on CXF-5306:

We'd probalby need to see the full test case with all the schemas and such.

In anycase, can you try generating the client with the "-exsh true" flag added to the wsdl2java?
  That should change the method signature a bit to reflect the required SOAP header. The soap
binding in the wsdl describes a header (MetaHeader element) so it looks like it's using the
parameter for that and then there isn't anything left for the body.  It SHOULDN'T be doing
that which is why I'd like a full test case, but adding the additional flags to wsdl2java
may provide a workaround for you.
> Soap body in header
> -------------------
>                 Key: CXF-5306
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.7.6
>            Reporter: matej
>         Attachments: MessageDelivery.wsdl
> I am using apache-cxf-2.7.6. I generated soap client from wsdl. In Java code I set values
for the request object and send request. Soap xml request is not valid. In the header is request
body and soap:body is empty. This is generated xml which is not valid:
> {code:xml}
> <soap:Envelope xmlns:soap="">
>    <soap:Header>
>       <ns7:MetaHeader xmlns:ns12="" xmlns:ns11=""
xmlns:ns10="" xmlns:ns9=""
xmlns:ns8="" xmlns:ns7=""
xmlns:ns6="" xmlns:ns5="" xmlns:ns4=""
xmlns:ns3="" xmlns:ns2=""
>          <ns2:EmailToFields>
>             <EmailToField></EmailToField>
>          </ns2:EmailToFields>
>          <EmailSubject>test</EmailSubject>
>          <EmailFromField></EmailFromField>
>          <ns2:EmailBody>Hello World!</ns2:EmailBody>
>          <DeliveryPriority>1</DeliveryPriority>
>       </ns7:MetaHeader>
>    </soap:Header>
>    <soap:Body/>
> </soap:Envelope>
> {code}
> Here is the code how I am sending request:
> {code:java}
>       MessageDelivery messageDelivery = new MessageDelivery();
> 			SendEmailPortType client = messageDelivery.getSendEmailPortTypeBindingPort(); 
> 			org.apache.cxf.endpoint.Client clientEnd = ClientProxy.getClient(client);
> 			clientEnd.getOutInterceptors().add(new MyLogInterceptor());
> 			SendEmailReq sendEmailReq = new SendEmailReq();
> 			sendEmailReq.setEmailSubject("test");
> 			sendEmailReq.setEmailBody(body);
> 			sendEmailReq.setEmailFromField("");
> 			sendEmailReq.setEmailToFields(new SendEmailReq.EmailToFields());
> 			sendEmailReq.getEmailToFields().getEmailToField().add("");
> 			sendEmailReq.setDeliveryPriority(new Integer(1));
> 			client.sendEmailV1(sendEmailReq);
> {code}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message