Bugfix/header values composing #381

Merged
merged 5 commits into from Jul 20, 2016

Projects

None yet

2 participants

@coutoPL
Contributor
coutoPL commented Jul 20, 2016 edited

Ref #366

Soap envelope should be:

<soap12:Envelope>
    <soap12:Header>
      <sessionId>session</sessionId>
      <correlationId>10001</correlationId>
    </soap12:Header>
    <soap12:Body>
      <username>User</username>
    </soap12:Body>
</soap12:Envelope>

not:

<soap12:Envelope>
    <soap12:Header>
      session10001
    </soap12:Header>
    <soap12:Body>
      User
    </soap12:Body>
</soap12:Envelope>

for tested WSDLs (implicit_header_example.wsdl, explicit_header_example.wsdl and implicit_header_multiple_part_header.wsdl)

@eed3si9n eed3si9n commented on an outdated diff Jul 20, 2016
integration/src/test/scala/Wsdl11Soap12Test.scala
@@ -38,14 +38,18 @@ object Wsdl11Soap12Test extends TestBase {
|val service = new implicitheader.UserBindings with scalaxb.SoapClients with scalaxb.HttpClients {
| override def httpClient = new HttpClient {
| override def request(in: String, address: java.net.URI, headers: Map[String, String]): String = {
+ | println("!!!" + in)
@eed3si9n eed3si9n and 1 other commented on an outdated diff Jul 20, 2016
...rc/main/scala/scalaxb/compiler/wsdl11/GenSource.scala
@@ -300,9 +300,9 @@ trait {interfaceTypeName} {{
private def implicitHeaderParts(headers: Seq[HeaderBinding]): Seq[XPartType] =
headers.flatMap { header =>
- context.messages(splitTypeName(header.message))
- .part.filter(_.name == Some(header.part))
- .map(x => x.copy(name = x.name.map(camelCase)))
+ context.messages(splitTypeName(header.message)).part
+ .filter(_.name.contains(header.part))
@eed3si9n
eed3si9n Jul 20, 2016 Owner

Does this change the behavior?

@coutoPL
coutoPL Jul 20, 2016 Contributor

no ... IMO it's just cleaner

@coutoPL
coutoPL Jul 20, 2016 Contributor

ok, but there is no contain in Option class of scala 2.10. Reverted.

@eed3si9n
Owner

Thanks for following up with a quick fix!

@eed3si9n
Owner

I don't know how Apache CXF encodes implicit headers, but if it's supported, it might be worth running the server and hitting it with scalaxb like here:

@coutoPL
Contributor
coutoPL commented Jul 20, 2016

I've tried to force apache CXF to generate wsdl with implicit headers and unfortunately I couldn't. Google says nothing about using implicit headers by CXF, so I guess it's impossible to achieve.

@eed3si9n
Owner

I'm going to restart Travis to see what happens. I think I've seen it fail like that before.

@eed3si9n eed3si9n merged commit 40a4249 into eed3si9n:master Jul 20, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@coutoPL coutoPL deleted the coutoPL:bugfix/header_values_composing branch Nov 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment