2017-11-11 11 views
0

私はこの記事プレイSOAPクライアント

https://playframework.github.io/play-soap/SbtWsdl.html

これに基づいてを読んでいます。私はsbt compileを行うと、私は、プラグインがいくつかのコードを生成し、次のbuild.sbtファイル

name := "PlaySOAPClient" 
version := "1.0" 
scalaVersion := "2.11.8" 
libraryDependencies ++= Seq(
    "com.typesafe.play" % "play-soap-client_2.11" % "1.1.3" 
) 

WsdlKeys.packageName := Some("com.foo") 
WsdlKeys.wsdlTasks in Compile := Seq(
    WsdlKeys.WsdlTask((sourceDirectory.value/"main"/"wsdl"/"foo.wsdl").toURI.toURL) 
) 

とplugins.sbt

resolvers += Resolver.url("play-sbt-plugins", url("https://dl.bintray.com/playframework/sbt-plugin-releases/"))(Resolver.ivyStylePatterns) 

addSbtPlugin("com.typesafe.sbt" % "sbt-play-soap" % "1.1.3") 

を書きました。そのコードはコンパイルされません。

Error:scalac: missing or invalid dependency detected while loading class file 'PlaySoapClient.class'. 
Could not access type Configuration in value play.api, 
because it (or its dependencies) are missing. Check your build definition for 
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) 
A full rebuild may help if 'PlaySoapClient.class' was compiled against an incompatible version of play.api. 
Warning:scalac: Class javax.inject.Singleton not found - continuing with a stub. 
/Users/User/IdeaProjects/PlaySOAPClient/target/scala-2.11/wsdl/main/sources/com/foo/webservices/FooWebService.scala 
Error:(13, 8) object inject is not a member of package javax 
@javax.inject.Singleton 
Error:(14, 107) object api is not a member of package play 
class FooWebService @javax.inject.Inject() (apacheCxfBus: play.soap.ApacheCxfBus, configuration: play.api.Configuration) extends play.soap.PlaySoapClient(apacheCxfBus, configuration) { 
Error:(14, 32) object inject is not a member of package javax 
class FooWebService @javax.inject.Inject() (apacheCxfBus: play.soap.ApacheCxfBus, configuration: play.api.Configuration) extends play.soap.PlaySoapClient(apacheCxfBus, configuration) { 

依存関係が不明な人はいませんか?これは、クライアント側アプリケーションであり、このライブラリーを使用してSOAP呼び出しを行うことに注意してください。私は、プレイフレームワークのサーバーサイドの依存関係は望んでいません。

私の希望は、コンソールアプリケーションでプレイソープをスタンドアロンライブラリとして使用して石鹸呼び出しを行うことができるということです。

+0

あなたのバージョンは何ですか? 'src/main/wsdl/foo.wsdl'には何が入っていますか? –

+0

sbt.version = 0.13.16。 foo.wsdlはSOAPエンドポイントを説明します。プラグインはこのファイルを見て、SOAPプロキシコードを生成します。 –

答えて

1

は(sbt update後に)動作するはずsbt compileその後

libraryDependencies += "com.typesafe.play" %% "play" % "2.6.7" intransitive() 

build.sbt に依存関係を追加します。

+0

しかし、それは私のアプリケーションでプレーフレームワークサーバー側全体を含みます。私は、プレイ・ソープの文書を読んで、それがプレイ・フレームワーク全体に依存せずに独立して使用できるという指示を得ました。 –

+0

いいえ、Playフレームワーク全体では、build.sbtとplugins.sbtの 'addSbtPlugin(" com.ypesafe.play "%" sbt-plugin "%" 2.6.7 ")'でより多くの依存関係が必要です。この依存関係がなければ、 'play.api.Configuration'はありません(あなたのエラーメッセージを見てください)。この依存関係を追加するのに何が問題になりますか? –

+0

問題は私のライブラリが多くのアプリケーションで使用されていることです。あまりにも多くの競合があります。私は依存関係を最小限に保つ必要があります。だからこそ私は依存性の足跡をできるだけ少なく保つ必要があるのです。 –

関連する問題