xmlprotocol.scala not compiling - not found: value value #267

Closed
tomhaigh opened this Issue Jun 24, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@tomhaigh

I have a wsdl that I am trying to import using the command line tool (on Windows) using the following command:

scalaxb -p packageName -d . .\service.wsdl

It is generating code in xmlprotocol.scala as follows:

   def subscribe(subscribe: testPackage.Subscribe, sessionHeader: testPackage.SessionHeader): Future[testPackage.SubscribeResponse] = 
    soapClient.requestResponse(scalaxb.toXML(value, Some("http://api.zuora.com/"), "subscribe", defaultScope),
        scalaxb.toXML(sessionHeader, Some("http://api.zuora.com/"), "SessionHeader", defaultScope), defaultScope, baseAddress, "POST", Some(new java.net.URI(""))).transform({ case (header, body) => 
        scalaxb.fromXML[testPackage.SubscribeResponse]((body.headOption getOrElse {body}), Nil) }, {
          case x: scalaxb.Soap11Fault[_] => x.asFault[testPackage.UnexpectedErrorFault]
          case x => x
        })

It seems a variable named value is being referenced that is undeclared?

The wsdl can be found here: https://raw.githubusercontent.com/zuora/java-quickstart/master/zuora.a.38.0.wsdl

@eed3si9n eed3si9n added the bug label Jun 30, 2014

@eed3si9n eed3si9n added this to the 1.2.1 milestone Jun 30, 2014

@eed3si9n eed3si9n closed this in 43b9b24 Jun 30, 2014

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jun 30, 2014

Owner

Thanks for the report. This was a scalaxb that was introduced recently. The fix is part of 1.2.1-SNAPSHOT if you want to test it out.

Owner

eed3si9n commented Jun 30, 2014

Thanks for the report. This was a scalaxb that was introduced recently. The fix is part of 1.2.1-SNAPSHOT if you want to test it out.

@tomhaigh

This comment has been minimized.

Show comment
Hide comment
@tomhaigh

tomhaigh Jul 1, 2014

Thanks for fixing. It compiles fine now.

tomhaigh commented Jul 1, 2014

Thanks for fixing. It compiles fine now.

@tomhaigh

This comment has been minimized.

Show comment
Hide comment
@tomhaigh

tomhaigh Jul 1, 2014

Actually, I may have been wrong, sorry. I installed the new version using conscript - scalaxb --version now shows scalaxb 1.2.1-SNAPSHOT

But my xmlprotocol.scala still has the same issue:

[error] C:\zuora\xb\xmlprotocol.scala:4530: not found: value value
[error]         soapClient.requestResponse(scalaxb.toXML(value, Some("http://api.zuora.com/"), "subscribe", defaultScope),

Is there something I am missing? Apologies for thinking it was working before.

tomhaigh commented Jul 1, 2014

Actually, I may have been wrong, sorry. I installed the new version using conscript - scalaxb --version now shows scalaxb 1.2.1-SNAPSHOT

But my xmlprotocol.scala still has the same issue:

[error] C:\zuora\xb\xmlprotocol.scala:4530: not found: value value
[error]         soapClient.requestResponse(scalaxb.toXML(value, Some("http://api.zuora.com/"), "subscribe", defaultScope),

Is there something I am missing? Apologies for thinking it was working before.

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jul 1, 2014

Owner

It's working for me on my machine. I created "zuora" branch under scalaxb-sample to test this - https://github.com/eed3si9n/scalaxb-sample/tree/zuora

and I get

      def subscribe(subscribe: zuora.Subscribe, sessionHeader: zuora.SessionHeader): Future[zuora.SubscribeResponse] = 
        soapClient.requestResponse(scalaxb.toXML(subscribe, Some("http://api.zuora.com/"), "subscribe", defaultScope),
            scalaxb.toXML(sessionHeader, Some("http://api.zuora.com/"), "SessionHeader", defaultScope), defaultScope, baseAddress, "POST", Some(new java.net.URI(""))).transform({ case (header, body) => 
            scalaxb.fromXML[zuora.SubscribeResponse]((body.headOption getOrElse {body}), Nil) }, {
              case x: scalaxb.Soap11Fault[_] => x.asFault[zuora.UnexpectedErrorFault]
              case x => x
            })

It's possible that I didn't publish the artifact correctly, or you've grabbed an earlier snapshot of 1.2.1-SNAPSHOT. I think you can re-download it by running:

$ cs --clean-boot
$ scalaxb --version
Owner

eed3si9n commented Jul 1, 2014

It's working for me on my machine. I created "zuora" branch under scalaxb-sample to test this - https://github.com/eed3si9n/scalaxb-sample/tree/zuora

and I get

      def subscribe(subscribe: zuora.Subscribe, sessionHeader: zuora.SessionHeader): Future[zuora.SubscribeResponse] = 
        soapClient.requestResponse(scalaxb.toXML(subscribe, Some("http://api.zuora.com/"), "subscribe", defaultScope),
            scalaxb.toXML(sessionHeader, Some("http://api.zuora.com/"), "SessionHeader", defaultScope), defaultScope, baseAddress, "POST", Some(new java.net.URI(""))).transform({ case (header, body) => 
            scalaxb.fromXML[zuora.SubscribeResponse]((body.headOption getOrElse {body}), Nil) }, {
              case x: scalaxb.Soap11Fault[_] => x.asFault[zuora.UnexpectedErrorFault]
              case x => x
            })

It's possible that I didn't publish the artifact correctly, or you've grabbed an earlier snapshot of 1.2.1-SNAPSHOT. I think you can re-download it by running:

$ cs --clean-boot
$ scalaxb --version

@eed3si9n eed3si9n modified the milestones: 1.3.0, 1.2.1 Nov 4, 2014

eed3si9n added a commit that referenced this issue Jul 13, 2015

remove zuora.wsdl
zuora.wsdl came in as part of #267.
Under portType "Soap", the operation "subscribe" has an input message
called zns:subscribeRequest. This message has a single part called
parameters.
However under binding "SoapBinding", the operation
"subscribe" has an input split into soap:header and soap:body, with
soap:header introducing an additional part called "SessionHeader".
I need to confirm if this should be supported by the spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment